-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Tests #101
Comments
I've been using |
When I was testing some async hooks I wasn't able to adequately get around the |
pick the test tools and make a test branch start it. |
Please see pull request #221 :) let me know what you guys think |
Can I help with this? I love this collection of hooks and I like adding tests so I'm more than happy to help with this. I've written tests for hooks before just with react-testing-library by creating a fake component within the test itself, but react-hooks-testing-library is another good option (which basically do the same: wrap the hook into a fake component and return the results). I've seen some tests already added by @ankithkonda so the set up and the structure is already defined, I can add more tests following same pattern. |
@Belco90 that is very very welcome! |
Ok so my idea is to add tests for all hooks section by section on storybook (animation, lifecycle, state, etc) and create a PR for each of those sections. Does that make sense for you? I'll start from animation section since it already has some tests and are simple to be tested. |
@Belco90 Yes, it does. |
It took me longer as expected as I was on holidays, but PR for first block of tests ready! #500 |
Second block of tests ready! #554 From now on I'll keep adding tests by blocks but I'll create a PR for each hook test, so 1) I avoid re-doing tests done by someone else while I create my PR, 2) I have my branches up to date and I don't have to keep it updated with master, and 3) I can merge bug fixes asap if I found any issue while testing. |
@streamich I've edited your description to use it as pending hooks and blocks I need to test. |
I don't know if you plan to keep the conversation about tests in this issue but just in case, just created a PR adding tests for useWindowScroll: #1183 following the same style @ankithkonda used for useWindowSize. |
@gerardkabre Sorry but I can't continue adding tests here since I've been really busy lately. However, I think I added a nice bunch of tests here to get a solid base to keep testing other hooks. |
Pending tests to be added
The text was updated successfully, but these errors were encountered: