-
Notifications
You must be signed in to change notification settings - Fork 232
Added global cleanup #16
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 18 18
=====================================
Hits 18 18 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a section to the README about the usage of this cleanup helper?
Other than that this is great, thanks!
I should have read the description better as you explicitly mentioned documentation. I think your suggestion of adding it to the |
Added instructions in |
Thanks @marquesm91. I'll put together a release for this later (I really need to automate this). |
It looks like all of the cleanup functionality was removed. Is there any particular reason why? |
Hi @jljorgenson18, Yes, we changed the renderer from |
Got it. Rendering though is only one facet to cleanup. If you have a side effect in useEffect (like a window event listener), would the cleanup function returned from useEffect get called? |
We never handled that explicitly (perhaps we should?). Usually you would |
What:
Added global cleanup
Why:
To ease the cleanup tests using a global setup file
How:
Added in root
cleanup-after-each.js
to requirecleanup
function and call insideafterEach
Checklist:
I don't add anything to Documentation because
react-testing-library
don't. But if it is necessary I can complete cleanup() section with an exampleCloses #13