Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

‎src/pure.js‎

Lines changed: 1 addition & 15 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /