-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Swap expect(ReactNoop) for expect(Scheduler) #14971
Conversation
79e462f
to
6ce727e
Compare
Details of bundled changes.Comparing: ccb2a8a...476d05f react-test-renderer
react-noop-renderer
jest-react
Generated by 🚫 dangerJS |
6ce727e
to
00b3c37
Compare
In the previous commits, I upgraded our custom Jest matchers for the noop and test renderers to use Scheduler under the hood. Now that all these matchers are using Scheduler, we can drop support for passing ReactNoop and test roots and always pass Scheduler directly.
I also noticed we don't need to regenerator runtime in noop anymore.
00b3c37
to
476d05f
Compare
@@ -599,7 +601,7 @@ describe('ReactIncrementalSideEffects', () => { | |||
// render some higher priority work. The middle content will bailout so | |||
// it remains untouched which means that it should reuse it next time. | |||
ReactNoop.render(<Foo text="foo" step={1} />); | |||
expect(ReactNoop).toFlushAndYield(['Foo', 'Content', 'Bar', 'Bar']); | |||
expect(Scheduler).toFlushAndYield(['Foo', 'Content', 'Bar', 'Bar']); |
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.
This seems very confused to me because shouldComponentUpdate
returns false
but the renderer(ReactNoop) still chooses to render it(the Content
component) which is very different to the DOM renderer, any details would you mind to share?
* Swap expect(ReactNoop) for expect(Scheduler) In the previous commits, I upgraded our custom Jest matchers for the noop and test renderers to use Scheduler under the hood. Now that all these matchers are using Scheduler, we can drop support for passing ReactNoop and test roots and always pass Scheduler directly. * Externalize Scheduler in noop and test bundles I also noticed we don't need to regenerator runtime in noop anymore.
In the previous commits, I upgraded our custom Jest matchers for the noop and test renderers to use Scheduler under the hood.
Now that all these matchers are using Scheduler, we can drop support for passing ReactNoop and test roots and always pass Scheduler directly.