-
Notifications
You must be signed in to change notification settings - Fork 45.6k
/
setupTests.www.js
41 lines (34 loc) · 1.15 KB
/
setupTests.www.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'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__;
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.enableIsInputPending = __VARIANT__;
actual.enableIsInputPendingContinuous = __VARIANT__;
actual.enableProfiling = __VARIANT__;
actual.enableSchedulerDebugging = __VARIANT__;
return actual;
});
global.__WWW__ = true;