-
Notifications
You must be signed in to change notification settings - Fork 49.3k
[act] flush suspense fallbacks in tests #16240
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
threepointone
merged 1 commit into
facebook:master
from
threepointone:flush-suspense-fallbacks
Jul 30, 2019
Merged
[act] flush suspense fallbacks in tests #16240
threepointone
merged 1 commit into
facebook:master
from
threepointone:flush-suspense-fallbacks
Jul 30, 2019
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
Details of bundled changes.Comparing: e6a0473...ad9b407 react-art
react-dom
react-test-renderer
react-reconciler
react-native-renderer
Generated by 🚫 dangerJS |
acdlite
requested changes
Jul 30, 2019
b6a9cd4
to
f6eb32d
Compare
I've updated the PR, but I do want to add at least a few tests (even if just a few) that just verify that this works in product-like code. will do before eod. EDIT: done. |
322b17b
to
e117bcb
Compare
e27af9c
to
d3108b0
Compare
acdlite
approved these changes
Jul 30, 2019
acdlite
reviewed
Jul 30, 2019
d3108b0
to
b7eeca7
Compare
In this PR, for tests (specifically, code inside an `act()` scope), we immediately trigger work that would have otherwise required a timeout. This makes it simpler to tests loading/spinner states, and makes tests resilient to changes in React. For some of our tests(specifically, ReactSuspenseWithNoopRenderer-test.internal), we _don't_ want fallbacks to immediately trigger, because we're testing intermediate states and such. Added a feature flag `flushSuspenseFallbacksInTests` to disable this behaviour on a per case basis.
b7eeca7
to
ad9b407
Compare
acdlite
added a commit
to acdlite/react
that referenced
this pull request
Jul 31, 2019
So that it doesn't leak into the production bundle. Follow-up to facebook#16240.
acdlite
added a commit
that referenced
this pull request
Jul 31, 2019
* [act] Wrap IsThisRendererActing in DEV check So that it doesn't leak into the production bundle. Follow-up to #16240. * Disable Suspense fallback test in prod
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.
Opening this to share the approach andrew et al, and answer some pending questions.
In this PR, for tests (specifically, code inside an
act()
scope), we immediately trigger work that would have otherwise required a timeout. This makes it simpler to tests loading/spinner states, and makes tests resilient to changes in React.For some of our tests(specifically, ReactSuspenseWithNoopRenderer-test.internal), we don't want fallbacks to immediately trigger, because we're testing intermediate states and such. Added a feature flag
flushSuspenseFallbacksInTests
to disable this behaviour on a per case basis.Open questions -