We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4961964 commit 8669481Copy full SHA for 8669481
src/pure.js
@@ -43,21 +43,7 @@ configureDTL({
43
const previousActEnvironment = getIsReactActEnvironment()
44
setReactActEnvironment(false)
45
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
+ return await cb()
61
} finally {
62
setReactActEnvironment(previousActEnvironment)
63
}
0 commit comments