-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Use react-hooks-testing-library to test hooks #1259
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploy preview for react-redux-docs ready! Built with commit 83e84c4 |
timdorr
reviewed
Apr 24, 2019
timdorr
reviewed
Apr 24, 2019
I like it! It definitely cleans things up a bit for a number of tests cases. |
Perfect. Thanks! |
timdorr
pushed a commit
that referenced
this pull request
May 30, 2019
* Use react-hooks-testing-library to test hooks * Disable react/display-name rule with nested .eslintrc file
timdorr
pushed a commit
that referenced
this pull request
Jun 11, 2019
* Use react-hooks-testing-library to test hooks * Disable react/display-name rule with nested .eslintrc file
This was referenced Sep 3, 2019
This was referenced Oct 26, 2019
This was referenced Apr 9, 2020
albertodev7
pushed a commit
to albertodev7/react-redux
that referenced
this pull request
Dec 8, 2022
* Use react-hooks-testing-library to test hooks * Disable react/display-name rule with nested .eslintrc file
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For your consideration, I've updated the hook unit tests to use
react-hooks-testing-library
, which is similar toreact-testing-library
but with a focus on testing reuable hooks.The only hook tests I left using actual components were the
useSelector/lifeycle interactions
anduseSelector/performance optimizations and bail-outs
tests as they seem to rely on the interplay between theParent
andChild
components to work. I could probably hack something together to use thewrapper
to simulate the relationship, but I felt that they are actually better in their current form as it more clearly describes the relationship between the interactions.There are no hard feelings if you choose not to merge this and continue with the tests you have.