Move enableSyncDefaultUpdates to test config (#26847)
Ricky committed
May 24, 2023 at 18:25 UTC
ee4233bdbc71a7e09395a613c7dde01194d2a830
2 files changed
+9
-2
packages/shared/forks/ReactFeatureFlags.www.js
+3
-1
@@ -23,7 +23,6 @@ export const {
23
enableDebugTracing,
24
enableUseRefAccessWarning,
25
enableLazyContextPropagation,
26
- enableSyncDefaultUpdates,
26
enableUnifiedSyncLane,
27
enableTransitionTracing,
28
enableCustomElementPropertySupport,
@@ -106,5 +105,8 @@ export const enableUseMutableSource = true;
105
export const useModernStrictMode = false;
106
export const enableFizzExternalRuntime = true;
107
108
+// This is only used in VARIANT tests, setting it to true does nothing.
109
+export const enableSyncDefaultUpdates = false;
110
+
111
// Flow magic to verify the exports of this file match the original version.
112
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
scripts/jest/setupTests.www.js
+6
-1
@@ -6,7 +6,12 @@ jest.mock('shared/ReactFeatureFlags', () => {
6
() => jest.requireActual('shared/forks/ReactFeatureFlags.www-dynamic'),
7
{virtual: true}
8
);
9
- return jest.requireActual('shared/forks/ReactFeatureFlags.www');
9
+ const actual = jest.requireActual('shared/forks/ReactFeatureFlags.www');
10
+
11
+ // This flag is only used by tests, it should never be set elsewhere.
12
+ actual.enableSyncDefaultUpdates = __VARIANT__;
13
+
14
+ return actual;
15
});
16
17
jest.mock('scheduler/src/SchedulerFeatureFlags', () => {