We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f1e3a5 commit dd52f77Copy full SHA for dd52f77
src/tests/useQuery.test.js
@@ -732,4 +732,22 @@ describe('useQuery', () => {
732
733
await waitForElement(() => rendered.getByText('isFetching === false'))
734
})
735
+
736
+ test('should not schedule garbage collection, if cacheTimeout is set to `Infinity`', async () => {
737
+ function Page() {
738
+ const query = useQuery('test', () => 'fetched data', {
739
+ cacheTime: Infinity,
740
+ })
741
+ return <div>{query.data}</div>
742
+ }
743
744
+ const rendered = render(<Page />)
745
746
+ await waitForElement(() => rendered.getByText('fetched data'))
747
748
+ rendered.unmount()
749
750
+ const query = queryCache.getQuery('test')
751
+ expect(query.cacheTimeout).toBe(undefined)
752
753
0 commit comments