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:
Brian Vaughn
2018-12-01 13:03:19 -08:00
committed by GitHub
parent 1d25aa5787
commit 52bea95cfc
11 changed files with 156 additions and 20 deletions
+2
View File
@@ -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
+9
View File
@@ -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