@samitouri / QOS-React-2 / commits / 0033d1a98c

Fix failing tests in latest 16.x and 18.x Node versions (#25378)

Sebastian Silbermann committed Oct 1, 2022 at 23:12 UTC 0033d1a98c402a9e0ba8f03f702749d66cb0f6f0
1 file changed +8 -9
packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js
+8 -9
@@ -503,16 +503,15 @@ function runActTests(label, render, unmount, rerender) {
503 // @gate __DEV__
504 it('warns if you try to interleave multiple act calls', async () => {
505 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 - })();
506
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 + ]);
515
516 await sleep(150);
517 if (__DEV__) {