| 1 | 'use strict'; |
| 2 | |
| 3 | jest.mock('shared/ReactFeatureFlags', () => { |
| 4 | jest.mock( |
| 5 | 'ReactFeatureFlags', |
| 6 | () => jest.requireActual('shared/forks/ReactFeatureFlags.www-dynamic'), |
| 7 | {virtual: true} |
| 8 | ); |
| 9 | const actual = jest.requireActual('shared/forks/ReactFeatureFlags.www'); |
| 10 | |
| 11 | // Flags that aren't currently used, but we still want to force variants to keep the |
| 12 | // code live. |
| 13 | actual.disableInputAttributeSyncing = __VARIANT__; |
| 14 | |
| 15 | // These are hardcoded to true for the next release, |
| 16 | // but still run the tests against both variants until |
| 17 | // we remove the flag. |
| 18 | actual.disableClientCache = __VARIANT__; |
| 19 | |
| 20 | // Some value that doesn't impact existing tests |
| 21 | actual.ownerStackLimit = __VARIANT__ ? 500 : 1e4; |
| 22 | |
| 23 | return actual; |
| 24 | }); |
| 25 | |
| 26 | jest.mock('scheduler/src/SchedulerFeatureFlags', () => { |
| 27 | const schedulerSrcPath = process.cwd() + '/packages/scheduler'; |
| 28 | jest.mock( |
| 29 | 'SchedulerFeatureFlags', |
| 30 | () => |
| 31 | jest.requireActual( |
| 32 | schedulerSrcPath + '/src/forks/SchedulerFeatureFlags.www-dynamic' |
| 33 | ), |
| 34 | {virtual: true} |
| 35 | ); |
| 36 | const actual = jest.requireActual( |
| 37 | schedulerSrcPath + '/src/forks/SchedulerFeatureFlags.www' |
| 38 | ); |
| 39 | |
| 40 | // Add flags here that are not a dynamic on www, |
| 41 | // but we still want to run tests in both versions. |
| 42 | // <this list is empty> |
| 43 | |
| 44 | return actual; |
| 45 | }); |
| 46 | |
| 47 | global.__WWW__ = true; |