diff --git a/packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js b/packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js index 16637bdc091bc..32e90276825e4 100644 --- a/packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js +++ b/packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js @@ -1324,7 +1324,7 @@ describe('Timeline profiler', () => { expect(timelineData.batchUIDToMeasuresMap.size).toBe(2); }); - // @reactVersion >=18.0 + // @reactVersion >=18.2 it('should mark render yields', async () => { function Bar() { Scheduler.log('Bar'); @@ -1409,7 +1409,7 @@ describe('Timeline profiler', () => { expect(timelineData.componentMeasures).toHaveLength(2); }); - // @reactVersion >=18.0 + // @reactVersion >=18.2 it('should mark sync render with suspense that rejects', async () => { let rejectFn; let rejected = false; @@ -1467,7 +1467,7 @@ describe('Timeline profiler', () => { expect(timelineData.componentMeasures).toHaveLength(2); }); - // @reactVersion >=18.0 + // @reactVersion >=18.2 it('should mark concurrent render with suspense that resolves', async () => { let resolveFn; let resolved = false; @@ -1525,7 +1525,7 @@ describe('Timeline profiler', () => { expect(timelineData.componentMeasures).toHaveLength(2); }); - // @reactVersion >=18.0 + // @reactVersion >=18.2 it('should mark concurrent render with suspense that rejects', async () => { let rejectFn; let rejected = false; diff --git a/packages/react-devtools-shared/src/__tests__/preprocessData-test.js b/packages/react-devtools-shared/src/__tests__/preprocessData-test.js index 5a518c2bf4bfe..b822663c93861 100644 --- a/packages/react-devtools-shared/src/__tests__/preprocessData-test.js +++ b/packages/react-devtools-shared/src/__tests__/preprocessData-test.js @@ -1349,7 +1349,7 @@ describe('Timeline profiler', () => { ); }); - // @reactVersion >= 18.0 + // @reactVersion >= 18.2 it('should not warn when React finishes a previously long (async) update with a short (sync) update inside of an event', async () => { function Yield({id, value}) { Scheduler.log(`${id}:${value}`); @@ -1411,7 +1411,7 @@ describe('Timeline profiler', () => { }); describe('nested updates', () => { - // @reactVersion >= 18.0 + // @reactVersion >= 18.2 it('should not warn about short nested (state) updates during layout effects', async () => { function Component() { const [didMount, setDidMount] = React.useState(false); @@ -1442,7 +1442,7 @@ describe('Timeline profiler', () => { expect(event.warning).toBe(null); }); - // @reactVersion >= 18.0 + // @reactVersion >= 18.2 it('should not warn about short (forced) updates during layout effects', async () => { class Component extends React.Component { _didMount: boolean = false; @@ -1595,7 +1595,7 @@ describe('Timeline profiler', () => { ); }); - // @reactVersion >= 18.0 + // @reactVersion >= 18.2 it('should not warn about transition updates scheduled during commit phase', async () => { function Component() { const [value, setValue] = React.useState(0); @@ -1781,10 +1781,10 @@ describe('Timeline profiler', () => { }); describe('suspend during an update', () => { - // This also tests an edge case where the a component suspends while profiling + // This also tests an edge case where a component suspends while profiling // before the first commit is logged (so the lane-to-labels map will not yet exist). - // @reactVersion >= 18.0 - it('should warn about suspending during an udpate', async () => { + // @reactVersion >= 18.2 + it('should warn about suspending during an update', async () => { let promise = null; let resolvedValue = null; function readValue(value) { @@ -1841,7 +1841,7 @@ describe('Timeline profiler', () => { ); }); - // @reactVersion >= 18.0 + // @reactVersion >= 18.2 it('should not warn about suspending during an transition', async () => { let promise = null; let resolvedValue = null; diff --git a/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js b/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js index 741589ee947c9..c5dd04865cfb6 100644 --- a/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js +++ b/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js @@ -19,7 +19,12 @@ describe('Store component filters', () => { let utils; const act = async (callback: Function) => { - await React.unstable_act(callback); + if (React.unstable_act != null) { + await React.unstable_act(callback); + } else { + callback(); + } + jest.runAllTimers(); // Flush Bridge operations };