mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
f411e8990f
Adding `.internal` to a test file prevents it from being tested in build mode. The best practice is to instead gate the test based on whether the feature is enabled. Ideally we'd use the `@gate` pragma in these tests, but the `itRenders` test helpers don't support that.
28 lines
705 B
JavaScript
28 lines
705 B
JavaScript
'use strict';
|
|
|
|
jest.mock('shared/ReactFeatureFlags', () => {
|
|
jest.mock(
|
|
'ReactFeatureFlags',
|
|
() => jest.requireActual('shared/forks/ReactFeatureFlags.www-dynamic'),
|
|
{virtual: true}
|
|
);
|
|
return jest.requireActual('shared/forks/ReactFeatureFlags.www');
|
|
});
|
|
|
|
jest.mock('scheduler/src/SchedulerFeatureFlags', () => {
|
|
const schedulerSrcPath = process.cwd() + '/packages/scheduler';
|
|
jest.mock(
|
|
'SchedulerFeatureFlags',
|
|
() =>
|
|
jest.requireActual(
|
|
schedulerSrcPath + '/src/forks/SchedulerFeatureFlags.www-dynamic'
|
|
),
|
|
{virtual: true}
|
|
);
|
|
return jest.requireActual(
|
|
schedulerSrcPath + '/src/forks/SchedulerFeatureFlags.www'
|
|
);
|
|
});
|
|
|
|
global.__WWW__ = true;
|