Skip to content

Commit 37cfbec

Browse files
committed
refactor: code review changes
1 parent 8666b51 commit 37cfbec

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/waitFor.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { ErrorWithStack, copyStackTrace } from './helpers/errors';
66
import {
77
setTimeout,
88
clearTimeout,
9-
setImmediate,
109
jestFakeTimersAreEnabled,
1110
} from './helpers/timers';
1211
import { checkReactVersionAtLeast } from './react-versions';
@@ -89,7 +88,7 @@ function waitForInternal<T>(
8988
// of parallelization so we're fine.
9089
// https://stackoverflow.com/a/59243586/971592
9190
// eslint-disable-next-line no-await-in-loop
92-
await new Promise((resolve) => setImmediate(resolve));
91+
await flushMicroTasks();
9392
}
9493
} else {
9594
overallTimeoutTimer = setTimeout(handleTimeout, timeout);

0 commit comments

Comments
 (0)