mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fixed scheduler setTimeout fallback (#14358)
* Fixed scheduler setTimeout fallback * Moved unit-test-specific setTimeout code into a new NPM package, jest-mock-scheduler.
This commit is contained in:
@@ -56,6 +56,8 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
|
||||
toMatchRenderedOutput: JestReact.unstable_toMatchRenderedOutput,
|
||||
});
|
||||
|
||||
require('jest-mock-scheduler');
|
||||
|
||||
// We have a Babel transform that inserts guards against infinite loops.
|
||||
// If a loop runs for too many iterations, we throw an error and set this
|
||||
// global variable. The global lets us detect an infinite loop even if
|
||||
|
||||
@@ -462,6 +462,15 @@ const bundles = [
|
||||
externals: ['jest-diff'],
|
||||
},
|
||||
|
||||
/******* Jest Scheduler (experimental) *******/
|
||||
{
|
||||
bundleTypes: [NODE_DEV, NODE_PROD, FB_WWW_DEV, FB_WWW_PROD],
|
||||
moduleType: ISOMORPHIC,
|
||||
entry: 'jest-mock-scheduler',
|
||||
global: 'JestMockScheduler',
|
||||
externals: ['jest-diff'],
|
||||
},
|
||||
|
||||
/******* ESLint Plugin for Hooks (proposal) *******/
|
||||
{
|
||||
// TODO: it's awkward to create a bundle for this
|
||||
|
||||
Reference in New Issue
Block a user