Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Apr 7, 2022
1 parent 06dc802 commit 44bd862
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -584,10 +584,16 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
'calls setState inside componentWillUpdate or componentDidUpdate. React limits ' +
'the number of nested updates to prevent infinite loops.',
);
}).toErrorDev([
'Maximum update depth exceeded.',
'The result of getSnapshot should be cached to avoid an infinite loop',
]);
}).toErrorDev(
gate(flags => flags.enableUseSyncExternalStoreShim)
? [
'The result of getSnapshot should be cached to avoid an infinite loop',
]
: [
'Maximum update depth exceeded.',
'The result of getSnapshot should be cached to avoid an infinite loop',
],
);
});

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

0 comments on commit 44bd862

Please sign in to comment.