Skip to content

Commit

Permalink
Move enableSyncDefaultUpdates to test config (facebook#26847)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed May 24, 2023
1 parent 6fc3333 commit ee4233b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const {
enableDebugTracing,
enableUseRefAccessWarning,
enableLazyContextPropagation,
enableSyncDefaultUpdates,
enableUnifiedSyncLane,
enableTransitionTracing,
enableCustomElementPropertySupport,
Expand Down Expand Up @@ -106,5 +105,8 @@ export const enableUseMutableSource = true;
export const useModernStrictMode = false;
export const enableFizzExternalRuntime = true;

// This is only used in VARIANT tests, setting it to true does nothing.
export const enableSyncDefaultUpdates = false;

// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
7 changes: 6 additions & 1 deletion scripts/jest/setupTests.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ jest.mock('shared/ReactFeatureFlags', () => {
() => jest.requireActual('shared/forks/ReactFeatureFlags.www-dynamic'),
{virtual: true}
);
return jest.requireActual('shared/forks/ReactFeatureFlags.www');
const actual = jest.requireActual('shared/forks/ReactFeatureFlags.www');

// This flag is only used by tests, it should never be set elsewhere.
actual.enableSyncDefaultUpdates = __VARIANT__;

return actual;
});

jest.mock('scheduler/src/SchedulerFeatureFlags', () => {
Expand Down

0 comments on commit ee4233b

Please sign in to comment.