Skip to content

Commit 0033d1a

Browse files
authored
Fix failing tests in latest 16.x and 18.x Node versions (#25378)
1 parent 7b25b96 commit 0033d1a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -503,16 +503,15 @@ function runActTests(label, render, unmount, rerender) {
503503
// @gate __DEV__
504504
it('warns if you try to interleave multiple act calls', async () => {
505505
spyOnDevAndProd(console, 'error');
506-
// let's try to cheat and spin off a 'thread' with an act call
507-
(async () => {
508-
await act(async () => {
509-
await sleep(50);
510-
});
511-
})();
512506

513-
await act(async () => {
514-
await sleep(100);
515-
});
507+
await Promise.all([
508+
act(async () => {
509+
await sleep(50);
510+
}),
511+
act(async () => {
512+
await sleep(100);
513+
}),
514+
]);
516515

517516
await sleep(150);
518517
if (__DEV__) {

0 commit comments

Comments
 (0)