Skip to content

Commit 2cca3a4

Browse files
committed
Fix devtools tests after internal test changes
1 parent 05777ff commit 2cca3a4

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ describe('Timeline profiler', () => {
13241324
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
13251325
});
13261326

1327-
// @reactVersion >=18.0
1327+
// @reactVersion >=18.2
13281328
it('should mark render yields', async () => {
13291329
function Bar() {
13301330
Scheduler.log('Bar');
@@ -1409,7 +1409,7 @@ describe('Timeline profiler', () => {
14091409
expect(timelineData.componentMeasures).toHaveLength(2);
14101410
});
14111411

1412-
// @reactVersion >=18.0
1412+
// @reactVersion >=18.2
14131413
it('should mark sync render with suspense that rejects', async () => {
14141414
let rejectFn;
14151415
let rejected = false;
@@ -1467,7 +1467,7 @@ describe('Timeline profiler', () => {
14671467
expect(timelineData.componentMeasures).toHaveLength(2);
14681468
});
14691469

1470-
// @reactVersion >=18.0
1470+
// @reactVersion >=18.2
14711471
it('should mark concurrent render with suspense that resolves', async () => {
14721472
let resolveFn;
14731473
let resolved = false;
@@ -1525,7 +1525,7 @@ describe('Timeline profiler', () => {
15251525
expect(timelineData.componentMeasures).toHaveLength(2);
15261526
});
15271527

1528-
// @reactVersion >=18.0
1528+
// @reactVersion >=18.2
15291529
it('should mark concurrent render with suspense that rejects', async () => {
15301530
let rejectFn;
15311531
let rejected = false;

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ describe('Timeline profiler', () => {
13491349
);
13501350
});
13511351

1352-
// @reactVersion >= 18.0
1352+
// @reactVersion >= 18.2
13531353
it('should not warn when React finishes a previously long (async) update with a short (sync) update inside of an event', async () => {
13541354
function Yield({id, value}) {
13551355
Scheduler.log(`${id}:${value}`);
@@ -1411,7 +1411,7 @@ describe('Timeline profiler', () => {
14111411
});
14121412

14131413
describe('nested updates', () => {
1414-
// @reactVersion >= 18.0
1414+
// @reactVersion >= 18.2
14151415
it('should not warn about short nested (state) updates during layout effects', async () => {
14161416
function Component() {
14171417
const [didMount, setDidMount] = React.useState(false);
@@ -1442,7 +1442,7 @@ describe('Timeline profiler', () => {
14421442
expect(event.warning).toBe(null);
14431443
});
14441444

1445-
// @reactVersion >= 18.0
1445+
// @reactVersion >= 18.2
14461446
it('should not warn about short (forced) updates during layout effects', async () => {
14471447
class Component extends React.Component {
14481448
_didMount: boolean = false;
@@ -1595,7 +1595,7 @@ describe('Timeline profiler', () => {
15951595
);
15961596
});
15971597

1598-
// @reactVersion >= 18.0
1598+
// @reactVersion >= 18.2
15991599
it('should not warn about transition updates scheduled during commit phase', async () => {
16001600
function Component() {
16011601
const [value, setValue] = React.useState(0);
@@ -1781,10 +1781,10 @@ describe('Timeline profiler', () => {
17811781
});
17821782

17831783
describe('suspend during an update', () => {
1784-
// This also tests an edge case where the a component suspends while profiling
1784+
// This also tests an edge case where a component suspends while profiling
17851785
// before the first commit is logged (so the lane-to-labels map will not yet exist).
1786-
// @reactVersion >= 18.0
1787-
it('should warn about suspending during an udpate', async () => {
1786+
// @reactVersion >= 18.2
1787+
it('should warn about suspending during an update', async () => {
17881788
let promise = null;
17891789
let resolvedValue = null;
17901790
function readValue(value) {
@@ -1841,7 +1841,7 @@ describe('Timeline profiler', () => {
18411841
);
18421842
});
18431843

1844-
// @reactVersion >= 18.0
1844+
// @reactVersion >= 18.2
18451845
it('should not warn about suspending during an transition', async () => {
18461846
let promise = null;
18471847
let resolvedValue = null;

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ describe('Store component filters', () => {
1919
let utils;
2020

2121
const act = async (callback: Function) => {
22-
await React.unstable_act(callback);
22+
if (React.unstable_act != null) {
23+
await React.unstable_act(callback);
24+
} else {
25+
callback();
26+
}
27+
2328
jest.runAllTimers(); // Flush Bridge operations
2429
};
2530

0 commit comments

Comments
 (0)