We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9410b51 commit 58a8073Copy full SHA for 58a8073
src/waitFor.ts
@@ -6,7 +6,6 @@ import { ErrorWithStack, copyStackTrace } from './helpers/errors';
6
import {
7
setTimeout,
8
clearTimeout,
9
- setImmediate,
10
jestFakeTimersAreEnabled,
11
} from './helpers/timers';
12
import { checkReactVersionAtLeast } from './react-versions';
@@ -89,7 +88,7 @@ function waitForInternal<T>(
89
88
// of parallelization so we're fine.
90
// https://stackoverflow.com/a/59243586/971592
91
// eslint-disable-next-line no-await-in-loop
92
- await new Promise((resolve) => setImmediate(resolve));
+ await flushMicroTasks();
93
}
94
} else {
95
overallTimeoutTimer = setTimeout(handleTimeout, timeout);
0 commit comments