Merged
Conversation
Member
Author
|
I cleaned it up significantly :) |
Codecov Report
@@ Coverage Diff @@
## master #236 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 13 13
Lines 293 298 +5
Branches 67 67
=====================================
+ Hits 293 298 +5
Continue to review full report at Codecov.
|
c020cad to
d0d7943
Compare
5 tasks
Member
Author
|
🎉 This PR is included in version 3.19.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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
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.
What: add asyncWrapper config
Why: At first glance you're probably thinking: "Oh no, no no. No way." But think for a moment that react-testing-library can't just export its own
wait*APIs and make everything work, because thefindBy*queries all use thewaitForElementAPI that's exposed by dom-testing-library (not the one that would be wrapped by react-testing-library), so we have two options:findBy*query that exists today and keep that updated in the future if new queries are ever added. This would include wrappingwithin/getQueriesForElementso thefindBy*queries from those are are wrapped. In addition to wrapping all thewait*utilities.wait*APIs as this PR doesI don't like either of those solutions, but I dislike solution 2 WAY less.
How:
Add a config option called
asyncWrapperand wrap all thewait*APIs in that. The default just calls the callback so there's no real cost to doing it this way. I've tested this locally with and without my changes to react-testing-library and it works great (so people using a new dom-testing-library and an old react-testing-library will be fine). When I update react-testing-library I'll make sure to add a version bump to dom-testing-library so we don't wind up with the opposite situation.Checklist: