Skip to content

Commit

Permalink
internal: Less chance of test race conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Dec 18, 2024
1 parent a5086c4 commit aa2475b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ describe.each([
],
},
);
await act(async () => {
await new Promise(resolve => setTimeout(resolve, 0));
});

const fetches: Promise<any>[] = [];
const resolves: ((v: any) => void)[] = [];
Expand Down Expand Up @@ -493,7 +496,7 @@ describe.each([
}),
);
await act(async () => {
await new Promise(resolve => setTimeout(resolve, 0));
await new Promise(resolve => setTimeout(resolve, 1));
});

// second optimistic
Expand Down Expand Up @@ -607,6 +610,9 @@ describe.each([
],
},
);
await act(async () => {
await new Promise(resolve => setTimeout(resolve, 1));
});

const fetches: Promise<any>[] = [];
const resolves: ((v: any) => void)[] = [];
Expand Down

0 comments on commit aa2475b

Please sign in to comment.