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 5dc81dc commit c534bc1Copy full SHA for c534bc1
src/pure.js
@@ -37,21 +37,7 @@ configureDTL({
37
const previousActEnvironment = getIsReactActEnvironment()
38
setReactActEnvironment(false)
39
try {
40
- const result = await cb()
41
- // Drain microtask queue.
42
- // Otherwise we'll restore the previous act() environment, before we resolve the `waitFor` call.
43
- // The caller would have no chance to wrap the in-flight Promises in `act()`
44
- await new Promise(resolve => {
45
- setTimeout(() => {
46
- resolve()
47
- }, 0)
48
-
49
- if (jestFakeTimersAreEnabled()) {
50
- jest.advanceTimersByTime(0)
51
- }
52
- })
53
54
- return result
+ return await cb()
55
} finally {
56
setReactActEnvironment(previousActEnvironment)
57
}
0 commit comments