Skip to content

Commit 565e72d

Browse files
hoxyqAndyPengc12
authored andcommitted
fix: partially revert jest setup config removal to fix regression tests (facebook#28247)
Partially reverting what has been removed in facebook#28186. We need `'scheduler/tracing'` mock for React >= 16.8. The error: ``` Invariant Violation: It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling ``` Validated by running regression tests for the whole version matrix: ``` ./scripts/circleci/download_devtools_regression_build.js 16.0 --replaceBuild && node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion 16.0 --ci && ./scripts/circleci/download_devtools_regression_build.js 16.5 --replaceBuild && node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion 16.5 --ci && ./scripts/circleci/download_devtools_regression_build.js 16.8 --replaceBuild && node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion 16.8 --ci && ./scripts/circleci/download_devtools_regression_build.js 17.0 --replaceBuild && node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion 17.0 --ci && ./scripts/circleci/download_devtools_regression_build.js 18.0 --replaceBuild && node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion 18.0 --ci ```
1 parent 85e0466 commit 565e72d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

scripts/jest/devtools/config.build-devtools-regression.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ if (REACT_VERSION) {
3131
'^react-dom/client$'
3232
] = `<rootDir>/build/${NODE_MODULES_DIR}/react-dom`;
3333
}
34+
35+
setupFiles.push(require.resolve('./setupTests.build-devtools-regression'));
3436
}
3537

3638
module.exports = {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
// Regression tests use a React DOM profiling, so we need
4+
// to replace these tests with scheduler/tracing-profiling
5+
jest.mock('scheduler/tracing', () => {
6+
return jest.requireActual('scheduler/tracing-profiling');
7+
});

0 commit comments

Comments
 (0)