Skip to content

Commit 13c5a85

Browse files
committed
test: Don't retry flushActWork if flushUntilNextPaint threw
Fixes "ReferenceError: You are trying to access a property or method of the Jest environment after it has been torn down." in `ReactIncrementalErrorHandling-test.internal.js`
1 parent 1445acf commit 13c5a85

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/jest-react/src/internalAct.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ function flushActWork(resolve: () => void, reject: (error: any) => void) {
128128
Scheduler.unstable_flushUntilNextPaint();
129129
} catch (error) {
130130
reject(error);
131+
return
131132
}
132133

133134
// If Scheduler yields while there's still work, it's so that we can

0 commit comments

Comments
 (0)