Skip to content

Commit bc55d9b

Browse files
committed
Gate DevTools test to fix CI
This test started failing recently in older versions of React because the Scheduler priority inside a microtask is Normal instead of Immediate. This is expected because microtasks are not Scheduler tasks; it's an implementation detail. I gated the test to only run in the older versions of React, because it's a regression test for the legacy Suspense renderer. So it doesn't really need to run for new versions, because the legacy renderer is deprecated and will soon be removed. Test plan: ``` yarn test --build --project devtools --release-channel=experimental --reactVersion 18.0 --watch ```
1 parent 18282f8 commit bc55d9b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/react-devtools-shared/src/__tests__/profilingCache-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ describe('ProfilingCache', () => {
938938
}
939939
});
940940

941-
// @reactVersion >= 18.0
941+
// @reactVersion < 18.2
942942
it('should handle unexpectedly shallow suspense trees', () => {
943943
const container = document.createElement('div');
944944

@@ -963,7 +963,7 @@ describe('ProfilingCache', () => {
963963
2 => 0,
964964
},
965965
"passiveEffectDuration": null,
966-
"priorityLevel": "Normal",
966+
"priorityLevel": "Immediate",
967967
"timestamp": 0,
968968
"updaters": [
969969
{

scripts/jest/jest-cli.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ const devToolsConfig = './scripts/jest/config.build-devtools.js';
1616
const persistentConfig = './scripts/jest/config.source-persistent.js';
1717
const buildConfig = './scripts/jest/config.build.js';
1818

19+
const {ReactVersion} = require('../../ReactVersions');
20+
1921
const argv = yargs
2022
.parserConfiguration({
2123
// Important: This option tells yargs to move all other options not
@@ -109,6 +111,7 @@ const argv = yargs
109111
describe: 'DevTools testing for specific version of React',
110112
requiresArg: true,
111113
type: 'string',
114+
default: ReactVersion,
112115
},
113116
sourceMaps: {
114117
describe:

0 commit comments

Comments
 (0)