Skip to content

Commit 95d762e

Browse files
committed
Remove duplicate test
Accidentally committed two copies of this test during a rebase.
1 parent d4d1dc0 commit 95d762e

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

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

-23
Original file line numberDiff line numberDiff line change
@@ -570,29 +570,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
570570
}
571571
});
572572

573-
test('Infinite loop if getSnapshot keeps returning new reference', () => {
574-
const store = createExternalStore({});
575-
576-
function App() {
577-
const text = useSyncExternalStore(store.subscribe, () => ({}));
578-
return <Text text={JSON.stringify(text)} />;
579-
}
580-
581-
spyOnDev(console, 'error');
582-
const root = createRoot();
583-
584-
expect(() => act(() => root.render(<App />))).toThrow(
585-
'Maximum update depth exceeded. This can happen when a component repeatedly ' +
586-
'calls setState inside componentWillUpdate or componentDidUpdate. React limits ' +
587-
'the number of nested updates to prevent infinite loops.',
588-
);
589-
if (__DEV__) {
590-
expect(console.error.calls.argsFor(0)[0]).toMatch(
591-
'The result of getSnapshot should be cached to avoid an infinite loop',
592-
);
593-
}
594-
});
595-
596573
describe('extra features implemented in user-space', () => {
597574
test('memoized selectors are only called once per update', async () => {
598575
const store = createExternalStore({a: 0, b: 0});

0 commit comments

Comments
 (0)