diff --git a/scripts/jest/devtools/config.build-devtools-regression.js b/scripts/jest/devtools/config.build-devtools-regression.js index 672cb98258fde..2b8b650173c1e 100644 --- a/scripts/jest/devtools/config.build-devtools-regression.js +++ b/scripts/jest/devtools/config.build-devtools-regression.js @@ -31,6 +31,8 @@ if (REACT_VERSION) { '^react-dom/client$' ] = `/build/${NODE_MODULES_DIR}/react-dom`; } + + setupFiles.push(require.resolve('./setupTests.build-devtools-regression')); } module.exports = { diff --git a/scripts/jest/devtools/setupTests.build-devtools-regression.js b/scripts/jest/devtools/setupTests.build-devtools-regression.js new file mode 100644 index 0000000000000..a1221d53d2fa6 --- /dev/null +++ b/scripts/jest/devtools/setupTests.build-devtools-regression.js @@ -0,0 +1,7 @@ +'use strict'; + +// Regression tests use a React DOM profiling, so we need +// to replace these tests with scheduler/tracing-profiling +jest.mock('scheduler/tracing', () => { + return jest.requireActual('scheduler/tracing-profiling'); +});