Skip to content

Commit

Permalink
Fix failing tests in latest 16.x and 18.x Node versions (#25378)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Oct 1, 2022
1 parent 7b25b96 commit 0033d1a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,16 +503,15 @@ function runActTests(label, render, unmount, rerender) {
// @gate __DEV__
it('warns if you try to interleave multiple act calls', async () => {
spyOnDevAndProd(console, 'error');
// let's try to cheat and spin off a 'thread' with an act call
(async () => {
await act(async () => {
await sleep(50);
});
})();

await act(async () => {
await sleep(100);
});
await Promise.all([
act(async () => {
await sleep(50);
}),
act(async () => {
await sleep(100);
}),
]);

await sleep(150);
if (__DEV__) {
Expand Down

0 comments on commit 0033d1a

Please sign in to comment.