mirror of
https://github.com/facebook/react.git
synced 2026-02-26 03:25:25 +00:00
This has landed and is true everywhere, but let's keep the flag until it lands in the stable release.
48 lines
1.3 KiB
JavaScript
48 lines
1.3 KiB
JavaScript
'use strict';
|
|
|
|
jest.mock('shared/ReactFeatureFlags', () => {
|
|
jest.mock(
|
|
'ReactFeatureFlags',
|
|
() => jest.requireActual('shared/forks/ReactFeatureFlags.www-dynamic'),
|
|
{virtual: true}
|
|
);
|
|
const actual = jest.requireActual('shared/forks/ReactFeatureFlags.www');
|
|
|
|
// This flag is only used by tests, it should never be set elsewhere.
|
|
actual.forceConcurrentByDefaultForTesting = !__VARIANT__;
|
|
|
|
// Flags that aren't currently used, but we still want to force variants to keep the
|
|
// code live.
|
|
actual.disableInputAttributeSyncing = __VARIANT__;
|
|
|
|
// This is hardcoded to true for the next release,
|
|
// but still run the tests against both variants until
|
|
// we remove the flag.
|
|
actual.disableIEWorkarounds = __VARIANT__;
|
|
|
|
return actual;
|
|
});
|
|
|
|
jest.mock('scheduler/src/SchedulerFeatureFlags', () => {
|
|
const schedulerSrcPath = process.cwd() + '/packages/scheduler';
|
|
jest.mock(
|
|
'SchedulerFeatureFlags',
|
|
() =>
|
|
jest.requireActual(
|
|
schedulerSrcPath + '/src/forks/SchedulerFeatureFlags.www-dynamic'
|
|
),
|
|
{virtual: true}
|
|
);
|
|
const actual = jest.requireActual(
|
|
schedulerSrcPath + '/src/forks/SchedulerFeatureFlags.www'
|
|
);
|
|
|
|
// These flags are not a dynamic on www, but we still want to run
|
|
// tests in both versions.
|
|
actual.enableSchedulerDebugging = __VARIANT__;
|
|
|
|
return actual;
|
|
});
|
|
|
|
global.__WWW__ = true;
|