Skip to content

Commit 9fb5014

Browse files
committed
Use timers instead of act to force fallbacks to show
1 parent 76d4a7d commit 9fb5014

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/react-reconciler/src/__tests__/ReactLazy-test.internal.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,10 +1344,9 @@ describe('ReactLazy', () => {
13441344
expect(root).toMatchRenderedOutput('AB');
13451345

13461346
// Swap the position of A and B
1347-
ReactTestRenderer.act(() => {
1348-
root.update(<Parent swap={true} />);
1349-
expect(Scheduler).toFlushAndYield(['Init B2', 'Loading...']);
1350-
});
1347+
root.update(<Parent swap={true} />);
1348+
expect(Scheduler).toFlushAndYield(['Init B2', 'Loading...']);
1349+
jest.runAllTimers();
13511350

13521351
// The suspense boundary should've triggered now.
13531352
expect(root).toMatchRenderedOutput('Loading...');

0 commit comments

Comments
 (0)