Skip to content

Commit abaf9cc

Browse files
committed
Fix devtools regression tests
1 parent 447fc2a commit abaf9cc

File tree

3 files changed

+1
-38
lines changed

3 files changed

+1
-38
lines changed

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

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ describe('Timeline profiler', () => {
126126
setPerformanceMock(null);
127127
});
128128

129-
// @reactVersion >=18.0
130129
it('should mark sync render without suspends or state updates', () => {
131130
renderHelper(<div />);
132131

@@ -148,7 +147,6 @@ describe('Timeline profiler', () => {
148147
`);
149148
});
150149

151-
// @reactVersion >=18.0
152150
it('should mark concurrent render without suspends or state updates', () => {
153151
renderRootHelper(<div />);
154152

@@ -179,7 +177,6 @@ describe('Timeline profiler', () => {
179177
`);
180178
});
181179

182-
// @reactVersion >=18.0
183180
it('should mark render yields', async () => {
184181
function Bar() {
185182
Scheduler.unstable_yieldValue('Bar');
@@ -209,7 +206,6 @@ describe('Timeline profiler', () => {
209206
`);
210207
});
211208

212-
// @reactVersion >=18.0
213209
it('should mark sync render with suspense that resolves', async () => {
214210
const fakeSuspensePromise = Promise.resolve(true);
215211
function Example() {
@@ -252,7 +248,6 @@ describe('Timeline profiler', () => {
252248
`);
253249
});
254250

255-
// @reactVersion >=18.0
256251
it('should mark sync render with suspense that rejects', async () => {
257252
const fakeSuspensePromise = Promise.reject(new Error('error'));
258253
function Example() {
@@ -291,7 +286,6 @@ describe('Timeline profiler', () => {
291286
expect(clearedMarks).toContain(`--suspense-rejected-0-Example`);
292287
});
293288

294-
// @reactVersion >=18.0
295289
it('should mark concurrent render with suspense that resolves', async () => {
296290
const fakeSuspensePromise = Promise.resolve(true);
297291
function Example() {
@@ -343,7 +337,6 @@ describe('Timeline profiler', () => {
343337
`);
344338
});
345339

346-
// @reactVersion >=18.0
347340
it('should mark concurrent render with suspense that rejects', async () => {
348341
const fakeSuspensePromise = Promise.reject(new Error('error'));
349342
function Example() {
@@ -395,7 +388,6 @@ describe('Timeline profiler', () => {
395388
`);
396389
});
397390

398-
// @reactVersion >=18.0
399391
it('should mark cascading class component state updates', () => {
400392
class Example extends React.Component {
401393
state = {didMount: false};
@@ -450,7 +442,6 @@ describe('Timeline profiler', () => {
450442
`);
451443
});
452444

453-
// @reactVersion >=18.0
454445
it('should mark cascading class component force updates', () => {
455446
class Example extends React.Component {
456447
componentDidMount() {
@@ -504,7 +495,6 @@ describe('Timeline profiler', () => {
504495
`);
505496
});
506497

507-
// @reactVersion >=18.0
508498
it('should mark render phase state updates for class component', () => {
509499
class Example extends React.Component {
510500
state = {didRender: false};
@@ -558,7 +548,6 @@ describe('Timeline profiler', () => {
558548
`);
559549
});
560550

561-
// @reactVersion >=18.0
562551
it('should mark render phase force updates for class component', () => {
563552
let forced = false;
564553
class Example extends React.Component {
@@ -613,7 +602,6 @@ describe('Timeline profiler', () => {
613602
`);
614603
});
615604

616-
// @reactVersion >=18.0
617605
it('should mark cascading layout updates', () => {
618606
function Example() {
619607
const [didMount, setDidMount] = React.useState(false);
@@ -668,7 +656,6 @@ describe('Timeline profiler', () => {
668656
`);
669657
});
670658

671-
// @reactVersion >=18.0
672659
it('should mark cascading passive updates', () => {
673660
function Example() {
674661
const [didMount, setDidMount] = React.useState(false);
@@ -718,7 +705,6 @@ describe('Timeline profiler', () => {
718705
`);
719706
});
720707

721-
// @reactVersion >=18.0
722708
it('should mark render phase updates', () => {
723709
function Example() {
724710
const [didRender, setDidRender] = React.useState(false);
@@ -753,7 +739,6 @@ describe('Timeline profiler', () => {
753739
`);
754740
});
755741

756-
// @reactVersion >=18.0
757742
it('should mark sync render that throws', async () => {
758743
spyOn(console, 'error');
759744

@@ -816,7 +801,6 @@ describe('Timeline profiler', () => {
816801
`);
817802
});
818803

819-
// @reactVersion >=18.0
820804
it('should mark concurrent render that throws', async () => {
821805
spyOn(console, 'error');
822806

@@ -897,7 +881,6 @@ describe('Timeline profiler', () => {
897881
`);
898882
});
899883

900-
// @reactVersion >=18.0
901884
it('should mark passive and layout effects', async () => {
902885
function ComponentWithEffects() {
903886
React.useLayoutEffect(() => {
@@ -1034,7 +1017,6 @@ describe('Timeline profiler', () => {
10341017
});
10351018

10361019
describe('lane labels', () => {
1037-
// @reactVersion >=18.0
10381020
it('regression test SyncLane', () => {
10391021
renderHelper(<div />);
10401022

@@ -1056,7 +1038,6 @@ describe('Timeline profiler', () => {
10561038
`);
10571039
});
10581040

1059-
// @reactVersion >=18.0
10601041
it('regression test DefaultLane', () => {
10611042
renderRootHelper(<div />);
10621043
expect(clearedMarks).toMatchInlineSnapshot(`
@@ -1066,7 +1047,6 @@ describe('Timeline profiler', () => {
10661047
`);
10671048
});
10681049

1069-
// @reactVersion >=18.0
10701050
it('regression test InputDiscreteLane', async () => {
10711051
const targetRef = React.createRef(null);
10721052

@@ -1108,7 +1088,6 @@ describe('Timeline profiler', () => {
11081088
`);
11091089
});
11101090

1111-
// @reactVersion >=18.0
11121091
it('regression test InputContinuousLane', async () => {
11131092
const targetRef = React.createRef(null);
11141093

@@ -1205,7 +1184,6 @@ describe('Timeline profiler', () => {
12051184
utils.act(() => store.profilerStore.startProfiling());
12061185
});
12071186

1208-
// @reactVersion >=18.0
12091187
it('should mark sync render without suspends or state updates', () => {
12101188
renderHelper(<div />);
12111189

@@ -1222,7 +1200,6 @@ describe('Timeline profiler', () => {
12221200
`);
12231201
});
12241202

1225-
// @reactVersion >=18.0
12261203
it('should mark concurrent render without suspends or state updates', () => {
12271204
utils.act(() => renderRootHelper(<div />));
12281205

@@ -1239,7 +1216,6 @@ describe('Timeline profiler', () => {
12391216
`);
12401217
});
12411218

1242-
// @reactVersion >=18.0
12431219
it('should mark concurrent render without suspends or state updates', () => {
12441220
let updaterFn;
12451221

@@ -1586,7 +1562,6 @@ describe('Timeline profiler', () => {
15861562
expect(timelineData.componentMeasures).toHaveLength(2);
15871563
});
15881564

1589-
// @reactVersion >=18.0
15901565
it('should mark cascading class component state updates', () => {
15911566
class Example extends React.Component {
15921567
state = {didMount: false};
@@ -1647,7 +1622,6 @@ describe('Timeline profiler', () => {
16471622
`);
16481623
});
16491624

1650-
// @reactVersion >=18.0
16511625
it('should mark cascading class component force updates', () => {
16521626
let forced = false;
16531627
class Example extends React.Component {
@@ -1705,7 +1679,6 @@ describe('Timeline profiler', () => {
17051679
`);
17061680
});
17071681

1708-
// @reactVersion >=18.0
17091682
it('should mark render phase state updates for class component', () => {
17101683
class Example extends React.Component {
17111684
state = {didRender: false};
@@ -1776,7 +1749,6 @@ describe('Timeline profiler', () => {
17761749
`);
17771750
});
17781751

1779-
// @reactVersion >=18.0
17801752
it('should mark render phase force updates for class component', () => {
17811753
let forced = false;
17821754
class Example extends React.Component {
@@ -1844,7 +1816,6 @@ describe('Timeline profiler', () => {
18441816
`);
18451817
});
18461818

1847-
// @reactVersion >=18.0
18481819
it('should mark cascading layout updates', () => {
18491820
function Example() {
18501821
const [didMount, setDidMount] = React.useState(false);
@@ -1909,7 +1880,6 @@ describe('Timeline profiler', () => {
19091880
`);
19101881
});
19111882

1912-
// @reactVersion >=18.0
19131883
it('should mark cascading passive updates', () => {
19141884
function Example() {
19151885
const [didMount, setDidMount] = React.useState(false);
@@ -1973,7 +1943,6 @@ describe('Timeline profiler', () => {
19731943
`);
19741944
});
19751945

1976-
// @reactVersion >=18.0
19771946
it('should mark render phase updates', () => {
19781947
function Example() {
19791948
const [didRender, setDidRender] = React.useState(false);
@@ -2023,7 +1992,6 @@ describe('Timeline profiler', () => {
20231992
`);
20241993
});
20251994

2026-
// @reactVersion >=18.0
20271995
it('should mark sync render that throws', async () => {
20281996
spyOn(console, 'error');
20291997

@@ -2119,7 +2087,6 @@ describe('Timeline profiler', () => {
21192087
`);
21202088
});
21212089

2122-
// @reactVersion >=18.0
21232090
it('should mark concurrent render that throws', async () => {
21242091
spyOn(console, 'error');
21252092

@@ -2240,7 +2207,6 @@ describe('Timeline profiler', () => {
22402207
`);
22412208
});
22422209

2243-
// @reactVersion >=18.0
22442210
it('should mark passive and layout effects', async () => {
22452211
function ComponentWithEffects() {
22462212
React.useLayoutEffect(() => {

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ describe('Timeline profiler', () => {
613613
`);
614614
});
615615

616-
// @reactVersion >= 18.0
617616
it('should process a sample legacy render sequence', async () => {
618617
utils.legacyRender(<div />, document.createElement('div'));
619618

@@ -800,7 +799,6 @@ describe('Timeline profiler', () => {
800799
`);
801800
});
802801

803-
// @reactVersion >= 18.0
804802
it('should process a sample createRoot render sequence', async () => {
805803
function App() {
806804
const [didMount, setDidMount] = React.useState(false);
@@ -1947,7 +1945,6 @@ describe('Timeline profiler', () => {
19471945
global.IS_REACT_ACT_ENVIRONMENT = true;
19481946
});
19491947

1950-
// @reactVersion >= 18.0
19511948
it('should process a sample legacy render sequence', async () => {
19521949
utils.legacyRender(<div />, document.createElement('div'));
19531950
utils.act(() => store.profilerStore.stopProfiling());
@@ -2117,7 +2114,6 @@ describe('Timeline profiler', () => {
21172114
`);
21182115
});
21192116

2120-
// @reactVersion >= 18.0
21212117
it('should process a sample createRoot render sequence', async () => {
21222118
function App() {
21232119
const [didMount, setDidMount] = React.useState(false);

scripts/jest/preprocessor.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ module.exports = {
6868
if (filePath.match(/\.json$/)) {
6969
return src;
7070
}
71+
/////
7172
if (!filePath.match(/\/third_party\//)) {
7273
// for test files, we also apply the async-await transform, but we want to
7374
// make sure we don't accidentally apply that transform to product code.

0 commit comments

Comments
 (0)