File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 1- import { cleanup } from '@testing-library/react'
1+ /**
2+ * @jest -environment node
3+ */
4+
25import React from 'react'
36import { renderToString } from 'react-dom/server'
7+ import { usePaginatedQuery , queryCache } from '../index'
48
59describe ( 'useQuery SSR' , ( ) => {
6- beforeEach ( ( ) => {
7- const windowSpy = jest . spyOn ( global , 'window' , 'get' )
8- windowSpy . mockImplementation ( ( ) => undefined )
9- } )
10-
1110 afterEach ( ( ) => {
12- cleanup ( )
11+ queryCache . clear ( )
1312 } )
1413
1514 // See https://github.com/tannerlinsley/react-query/issues/70
1615 it ( 'should not cache queries on server' , async ( ) => {
17- // import react-query after mocking window
18- const { usePaginatedQuery, queryCache } = require ( '../index' )
19-
2016 function Page ( ) {
2117 const [ page , setPage ] = React . useState ( 1 )
2218 const { resolvedData } = usePaginatedQuery (
You can’t perform that action at this time.
0 commit comments