mirror of
https://github.com/facebook/react.git
synced 2026-02-22 11:51:55 +00:00
Bassed off: https://github.com/facebook/react/pull/32425
Wait to land internally.
[Commit to
review.](66aa6a4dbb)
This has landed everywhere
45 lines
1.2 KiB
JavaScript
45 lines
1.2 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');
|
|
|
|
// Flags that aren't currently used, but we still want to force variants to keep the
|
|
// code live.
|
|
actual.disableInputAttributeSyncing = __VARIANT__;
|
|
|
|
// These are hardcoded to true for the next release,
|
|
// but still run the tests against both variants until
|
|
// we remove the flag.
|
|
actual.disableClientCache = __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'
|
|
);
|
|
|
|
// Add flags here that are not a dynamic on www,
|
|
// but we still want to run tests in both versions.
|
|
// <this list is empty>
|
|
|
|
return actual;
|
|
});
|
|
|
|
global.__WWW__ = true;
|