Skip to content

Commit 8669481

Browse files
author
Sebastian Silbermann
committed
fix: Remove redundant flush of microtask queue
1 parent 4961964 commit 8669481

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

Diff for: src/pure.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,7 @@ configureDTL({
4343
const previousActEnvironment = getIsReactActEnvironment()
4444
setReactActEnvironment(false)
4545
try {
46-
const result = await cb()
47-
// Drain microtask queue.
48-
// Otherwise we'll restore the previous act() environment, before we resolve the `waitFor` call.
49-
// The caller would have no chance to wrap the in-flight Promises in `act()`
50-
await new Promise(resolve => {
51-
setTimeout(() => {
52-
resolve()
53-
}, 0)
54-
55-
if (jestFakeTimersAreEnabled()) {
56-
jest.advanceTimersByTime(0)
57-
}
58-
})
59-
60-
return result
46+
return await cb()
6147
} finally {
6248
setReactActEnvironment(previousActEnvironment)
6349
}

0 commit comments

Comments
 (0)