mirror of
https://github.com/facebook/react.git
synced 2026-02-25 21:55:00 +00:00
* Remove internal forwarding modules for /lib/ * Add *Entry suffix to all entry points * Don't bundle ReactNativeFeatureFlags since it's shimmed * Delete TestRendererStack * Switch tests at forwarding modules rather than via Jest * Share mocks between regular and equivalence fixtures * Rename environment flag to be more generic * Remove accidental variable name change * Minor naming changes for consistency Files that have two versions get the engine in variable name.
27 lines
911 B
JavaScript
27 lines
911 B
JavaScript
'use strict';
|
|
|
|
// We want to globally mock this but jest doesn't let us do that by default
|
|
// for a file that already exists. So we have to explicitly mock it.
|
|
jest.mock('ReactDOMFeatureFlags', () => {
|
|
const flags = require.requireActual('ReactDOMFeatureFlags');
|
|
return Object.assign({}, flags, {
|
|
useFiber: !!process.env.REACT_JEST_USE_FIBER,
|
|
});
|
|
});
|
|
jest.mock('ReactFeatureFlags', () => {
|
|
const flags = require.requireActual('ReactFeatureFlags');
|
|
return Object.assign({}, flags, {
|
|
disableNewFiberFeatures: true,
|
|
});
|
|
});
|
|
jest.mock('ReactNativeFeatureFlags', () => {
|
|
const flags = require.requireActual('ReactNativeFeatureFlags');
|
|
return Object.assign({}, flags, {
|
|
useFiber: !!process.env.REACT_JEST_USE_FIBER,
|
|
});
|
|
});
|
|
|
|
// Error logging varies between Fiber and Stack;
|
|
// Rather than fork dozens of tests, mock the error-logging file by default.
|
|
jest.mock('ReactFiberErrorLogger');
|