GeezerVison is showing github.com — Remove duplicate test · react/react@95d762e
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/use-sync-external-store/src/__tests__
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js -23Lines changed: 0 additions & 23 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -570,29 +570,6 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => { |
570 | 570 | } |
571 | 571 | }); |
572 | 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 | | - |
596 | 573 | describe('extra features implemented in user-space', () => { |
597 | 574 | test('memoized selectors are only called once per update', async () => { |
598 | 575 | const store = createExternalStore({a: 0, b: 0}); |
|