Skip to content

Commit d3dc608

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

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ describe('Timeline profiler', () => {
4848
ReactDOMClient = require('react-dom/client');
4949
Scheduler = require('scheduler');
5050

51-
const InternalTestUtils = require('internal-test-utils');
52-
waitFor = InternalTestUtils.waitFor;
53-
waitForAll = InternalTestUtils.waitForAll;
54-
waitForPaint = InternalTestUtils.waitForPaint;
55-
assertLog = InternalTestUtils.assertLog;
56-
5751
store = global.store;
5852
});
5953

@@ -1324,7 +1318,7 @@ describe('Timeline profiler', () => {
13241318
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
13251319
});
13261320

1327-
// @reactVersion >=18.0
1321+
// @reactVersion >=18.3
13281322
it('should mark render yields', async () => {
13291323
function Bar() {
13301324
Scheduler.log('Bar');
@@ -1409,7 +1403,7 @@ describe('Timeline profiler', () => {
14091403
expect(timelineData.componentMeasures).toHaveLength(2);
14101404
});
14111405

1412-
// @reactVersion >=18.0
1406+
// @reactVersion >=18.3
14131407
it('should mark sync render with suspense that rejects', async () => {
14141408
let rejectFn;
14151409
let rejected = false;
@@ -1467,7 +1461,7 @@ describe('Timeline profiler', () => {
14671461
expect(timelineData.componentMeasures).toHaveLength(2);
14681462
});
14691463

1470-
// @reactVersion >=18.0
1464+
// @reactVersion >=18.3
14711465
it('should mark concurrent render with suspense that resolves', async () => {
14721466
let resolveFn;
14731467
let resolved = false;
@@ -1525,7 +1519,7 @@ describe('Timeline profiler', () => {
15251519
expect(timelineData.componentMeasures).toHaveLength(2);
15261520
});
15271521

1528-
// @reactVersion >=18.0
1522+
// @reactVersion >=18.3
15291523
it('should mark concurrent render with suspense that rejects', async () => {
15301524
let rejectFn;
15311525
let rejected = false;

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

Lines changed: 6 additions & 6 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.3
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.3
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.3
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.3
15991599
it('should not warn about transition updates scheduled during commit phase', async () => {
16001600
function Component() {
16011601
const [value, setValue] = React.useState(0);
@@ -1783,7 +1783,7 @@ describe('Timeline profiler', () => {
17831783
describe('suspend during an update', () => {
17841784
// This also tests an edge case where the 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
1786+
// @reactVersion >= 18.3
17871787
it('should warn about suspending during an udpate', async () => {
17881788
let promise = null;
17891789
let resolvedValue = null;
@@ -1841,7 +1841,7 @@ describe('Timeline profiler', () => {
18411841
);
18421842
});
18431843

1844-
// @reactVersion >= 18.0
1844+
// @reactVersion >= 18.3
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)