Skip to content

Commit 44bd862

Browse files
committed
Fix test
1 parent 06dc802 commit 44bd862

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,16 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
584584
'calls setState inside componentWillUpdate or componentDidUpdate. React limits ' +
585585
'the number of nested updates to prevent infinite loops.',
586586
);
587-
}).toErrorDev([
588-
'Maximum update depth exceeded.',
589-
'The result of getSnapshot should be cached to avoid an infinite loop',
590-
]);
587+
}).toErrorDev(
588+
gate(flags => flags.enableUseSyncExternalStoreShim)
589+
? [
590+
'The result of getSnapshot should be cached to avoid an infinite loop',
591+
]
592+
: [
593+
'Maximum update depth exceeded.',
594+
'The result of getSnapshot should be cached to avoid an infinite loop',
595+
],
596+
);
591597
});
592598

593599
test('getSnapshot can return NaN without infinite loop warning', async () => {

0 commit comments

Comments
 (0)