Skip to content

Commit 387a645

Browse files
committed
Check deferRenderPhaseUpdateToNextBatch in test
1 parent 96b8030 commit 387a645

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,16 @@ describe('ReactIncrementalUpdates', () => {
320320
});
321321

322322
expect(instance.state).toEqual({a: 'a', b: 'b'});
323-
expect(Scheduler).toHaveYielded(['componentWillReceiveProps', 'render']);
323+
324+
if (gate(flags => flags.deferRenderPhaseUpdateToNextBatch)) {
325+
expect(Scheduler).toHaveYielded([
326+
'componentWillReceiveProps',
327+
'render',
328+
'render',
329+
]);
330+
} else {
331+
expect(Scheduler).toHaveYielded(['componentWillReceiveProps', 'render']);
332+
}
324333
});
325334

326335
it('updates triggered from inside a class setState updater', () => {

0 commit comments

Comments
 (0)