Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codemod act -> await act (4/?) #26338

Merged
merged 1 commit into from
Mar 8, 2023
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 @@ -984,7 +984,7 @@ describe('ReactHooksInspectionIntegration', () => {
children: ['count: ', '1'],
});

act(incrementCount);
await act(async () => incrementCount());
expect(renderer.toJSON()).toEqual({
type: 'div',
props: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1069,8 +1069,8 @@ describe('InspectedElement', () => {
});

async function loadPath(path) {
TestUtilsAct(() => {
TestRendererAct(() => {
await TestUtilsAct(async () => {
await TestRendererAct(async () => {
inspectElementPath(path);
jest.runOnlyPendingTimers();
});
Expand Down Expand Up @@ -1224,8 +1224,8 @@ describe('InspectedElement', () => {
});

async function loadPath(path) {
TestUtilsAct(() => {
TestRendererAct(() => {
await TestUtilsAct(async () => {
await TestRendererAct(async () => {
inspectElementPath(path);
jest.runOnlyPendingTimers();
});
Expand Down Expand Up @@ -1306,8 +1306,8 @@ describe('InspectedElement', () => {
});

async function loadPath(path) {
TestUtilsAct(() => {
TestRendererAct(() => {
await TestUtilsAct(async () => {
await TestRendererAct(async () => {
inspectElementPath(path);
jest.runOnlyPendingTimers();
});
Expand Down Expand Up @@ -1375,8 +1375,8 @@ describe('InspectedElement', () => {
}
`);

TestRendererAct(() => {
TestUtilsAct(() => {
await TestRendererAct(async () => {
await TestUtilsAct(async () => {
legacyRender(
<Example
nestedObject={{
Expand Down Expand Up @@ -1469,8 +1469,8 @@ describe('InspectedElement', () => {
});

async function loadPath(path) {
TestUtilsAct(() => {
TestRendererAct(() => {
await TestUtilsAct(async () => {
await TestRendererAct(async () => {
inspectElementPath(path);
jest.runOnlyPendingTimers();
});
Expand Down Expand Up @@ -1513,8 +1513,8 @@ describe('InspectedElement', () => {
}
`);

TestRendererAct(() => {
TestUtilsAct(() => {
await TestRendererAct(async () => {
await TestUtilsAct(async () => {
legacyRender(
<Example
nestedObject={{
Expand Down Expand Up @@ -1596,8 +1596,8 @@ describe('InspectedElement', () => {
});

async function loadPath(path) {
TestUtilsAct(() => {
TestRendererAct(() => {
await TestUtilsAct(async () => {
await TestRendererAct(async () => {
inspectElementPath(path);
jest.runOnlyPendingTimers();
});
Expand All @@ -1618,7 +1618,7 @@ describe('InspectedElement', () => {
}
`);

TestUtilsAct(() => {
await TestUtilsAct(async () => {
legacyRender(
<Example
nestedObject={{
Expand All @@ -1640,11 +1640,9 @@ describe('InspectedElement', () => {
expect(inspectedElement.props).toMatchInlineSnapshot(`
{
"nestedObject": {
"a": {
"b": {
"value": 2,
},
"value": 2,
"a": Dehydrated {
"preview_short": {…},
"preview_long": {b: {…}, value: 2},
},
"value": 2,
},
Expand Down Expand Up @@ -2833,7 +2831,7 @@ describe('InspectedElement', () => {
};
const toggleError = async forceError => {
await withErrorsOrWarningsIgnored(['ErrorBoundary'], async () => {
await TestUtilsAct(() => {
await TestUtilsAct(async () => {
bridge.send('overrideError', {
id: targetErrorBoundaryID,
rendererID: store.getRendererIDForElement(targetErrorBoundaryID),
Expand All @@ -2842,7 +2840,7 @@ describe('InspectedElement', () => {
});
});

TestUtilsAct(() => {
await TestUtilsAct(async () => {
jest.runOnlyPendingTimers();
});
};
Expand Down
Loading