Skip to content

Commit 3fd61cb

Browse files
committed
Add UnknownLane and flush unknown updates in a rAF
1 parent 6e2f38f commit 3fd61cb

33 files changed

+585
-288
lines changed

packages/jest-react/src/internalAct.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ export function act<T>(scope: () => Thenable<T> | T): Thenable<T> {
102102
// migrate existing tests.
103103
let didFlushWork;
104104
do {
105+
// Flush scheduled rAF.
106+
if (global.flushRequestAnimationFrameQueue) {
107+
global.flushRequestAnimationFrameQueue();
108+
}
109+
105110
didFlushWork = Scheduler.unstable_flushAllWithoutAsserting();
106111
} while (didFlushWork);
107112
return {
@@ -120,6 +125,11 @@ export function act<T>(scope: () => Thenable<T> | T): Thenable<T> {
120125
}
121126

122127
function flushActWork(resolve, reject) {
128+
// Flush scheduled rAF.
129+
if (global.flushRequestAnimationFrameQueue) {
130+
global.flushRequestAnimationFrameQueue();
131+
}
132+
123133
// Flush suspended fallbacks
124134
// $FlowFixMe: Flow doesn't know about global Jest object
125135
jest.runOnlyPendingTimers();

packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js

Lines changed: 162 additions & 155 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)