mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Use act in fuzz tester to flush expired work (#21108)
* Add failing hard-coded fuzz test Caught in CI by the fuzz tester. Related to expired updates. * Use `act` in fuzz tester to flush expired work Expired work gets scheduled in a microtask now, so we need to use `act` to flush it.
This commit is contained in:
@@ -432,7 +432,9 @@ describe('ReactIncrementalTriangle', () => {
|
||||
assertConsistentTree(activeLeafIndices);
|
||||
}
|
||||
// Flush remaining work
|
||||
Scheduler.unstable_flushAllWithoutAsserting();
|
||||
ReactNoop.act(() => {
|
||||
Scheduler.unstable_flushAllWithoutAsserting();
|
||||
});
|
||||
assertConsistentTree(activeLeafIndices, expectedCounterAtEnd);
|
||||
}
|
||||
|
||||
@@ -562,6 +564,12 @@ ${formatActions(actions)}
|
||||
['b', flush(7)],
|
||||
['c', toggle(0)],
|
||||
);
|
||||
|
||||
simulateMultipleRoots(
|
||||
['c', step(1)],
|
||||
['c', expire(5000)],
|
||||
['b', toggle(1)],
|
||||
);
|
||||
});
|
||||
|
||||
it('generative tests', () => {
|
||||
|
||||
Reference in New Issue
Block a user