Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down