-
Notifications
You must be signed in to change notification settings - Fork 273
feat: call "cleanup" automatically #238
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
Merged
Merged
Conversation
This file contains hidden or 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
In RTL, the |
Cool, I'll try to get back to this tomorrow :) |
...if an "afterEach" global function is defined, and process.env.RTL_SKIP_AUTO_CLEANUP is falsy. Taken from: https://github.com/testing-library/react-testing-library/blob/14670debd45236d2c5d0a61a83dadc72af1bef7c/src/index.js
# Conflicts: # src/index.js # yarn.lock
Changes target to |
thymikee
reviewed
May 20, 2020
thymikee
reviewed
May 20, 2020
thymikee
reviewed
May 20, 2020
thymikee
reviewed
May 20, 2020
thymikee
reviewed
May 20, 2020
Co-authored-by: Michał Pierzchała <[email protected]>
thymikee
approved these changes
May 20, 2020
@mdjastrzebski feel free to merge once you think it's ready :) |
thymikee
added a commit
that referenced
this pull request
May 28, 2020
* feat: add "cleanup" function * docs: add "cleanup" section * feat: automatically call "cleanup" after each test ...if an "afterEach" global function is defined, and process.env.RTL_SKIP_AUTO_CLEANUP is falsy. Taken from: https://github.com/testing-library/react-testing-library/blob/14670debd45236d2c5d0a61a83dadc72af1bef7c/src/index.js * docs: mention automatic cleanup * add within * fix lint * Updated tests, added auto-cleanup test * Added ways to prevent auto cleanup * Small fix * Code review changes * Update website/docs/API.md Co-authored-by: Michał Pierzchała <[email protected]> * More changes * Removed afterEach(cleanup) calls in examples * Code cleanup Co-authored-by: Michał Pierzchała <[email protected]> Co-authored-by: Maciej Jastrzebski <[email protected]>
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.
Summary
#234 (comment)
Fixes #234
Taken from here:
https://github.com/testing-library/react-testing-library/blob/14670debd45236d2c5d0a61a83dadc72af1bef7c/src/index.js
Notice how they also flush the microtask queue.
Test plan
None needed?