Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture all results a rendered hook produces. #496

Merged
merged 6 commits into from Dec 7, 2020
Merged

Conversation

mpeyper
Copy link
Member

@mpeyper mpeyper commented Dec 3, 2020

Fixes #461

What:

Make all results a rendered hook produces available to tests for assertions.

Why:

To test that initial states (prior to effects running) or other intermediate states were produced as expected. There has been some suggestion this could be useful for testing SSR scenarios as well.

How:

When the result gets update it we push it into an array and surface it through the result container returned from renderHook as result.all.

Checklist:

  • Documentation updated
  • Tests
  • Ready to be merged
  • Added myself to contributors table

@codecov
Copy link

codecov bot commented Dec 3, 2020

Codecov Report

Merging #496 (3091bf9) into master (33b8e1e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #496   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          126       128    +2     
  Branches        23        24    +1     
=========================================
+ Hits           126       128    +2     
Impacted Files Coverage Δ
src/pure.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 33b8e1e...3091bf9. Read the comment docs.

@joshuaellis joshuaellis mentioned this pull request Dec 3, 2020
@joshuaellis joshuaellis mentioned this pull request Dec 3, 2020
4 tasks
@mpeyper
Copy link
Member Author

mpeyper commented Dec 4, 2020

I want to hold off on this until after #502 so I can test semantic release (I'll amend my commit messages first).

@mpeyper mpeyper merged commit c3e09ed into master Dec 7, 2020
mpeyper added a commit that referenced this pull request Dec 7, 2020
There was an issue with a minor release, so this manual-releases.md
change is to release a new minor version.

Reference: #496
@github-actions
Copy link

github-actions bot commented Dec 7, 2020

🎉 This PR is included in version 3.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mpeyper mpeyper deleted the result-history branch December 15, 2020 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Capture intermediate updates when hook rerenders
2 participants