Remove duplicate test
Accidentally committed two copies of this test during a rebase.
Andrew Clark committed
Sep 8, 2021 at 11:49 UTC
95d762e406bd37c07693e3a5ddbd0f75289e8c3f
1 file changed
-23
packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js
-23
@@ -570,29 +570,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
570
}
571
});
572
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
-
573
describe('extra features implemented in user-space', () => {
574
test('memoized selectors are only called once per update', async () => {
575
const store = createExternalStore({a: 0, b: 0});