@@ -51,7 +51,7 @@ describe('QueryCache', () => {
5151 queryKey : queryKeyRef ,
5252 } )
5353
54- expect ( QueryClientOrigin . prototype . isFetching ) . toBeCalledWith ( {
54+ expect ( QueryClientOrigin . prototype . isFetching ) . toHaveBeenCalledWith ( {
5555 queryKey : queryKeyUnref ,
5656 } )
5757 } )
@@ -65,7 +65,7 @@ describe('QueryCache', () => {
6565 mutationKey : queryKeyRef ,
6666 } )
6767
68- expect ( QueryClientOrigin . prototype . isMutating ) . toBeCalledWith ( {
68+ expect ( QueryClientOrigin . prototype . isMutating ) . toHaveBeenCalledWith ( {
6969 mutationKey : queryKeyUnref ,
7070 } )
7171 } )
@@ -77,7 +77,7 @@ describe('QueryCache', () => {
7777
7878 queryClient . getQueryData ( queryKeyRef )
7979
80- expect ( QueryClientOrigin . prototype . getQueryData ) . toBeCalledWith (
80+ expect ( QueryClientOrigin . prototype . getQueryData ) . toHaveBeenCalledWith (
8181 queryKeyUnref ,
8282 )
8383 } )
@@ -92,7 +92,7 @@ describe('QueryCache', () => {
9292 queryFn : fn ,
9393 } )
9494
95- expect ( QueryClientOrigin . prototype . ensureQueryData ) . toBeCalledWith ( {
95+ expect ( QueryClientOrigin . prototype . ensureQueryData ) . toHaveBeenCalledWith ( {
9696 queryKey : queryKeyUnref ,
9797 queryFn : fn ,
9898 } )
@@ -105,7 +105,7 @@ describe('QueryCache', () => {
105105
106106 queryClient . getQueriesData ( { queryKey : queryKeyRef } )
107107
108- expect ( QueryClientOrigin . prototype . getQueriesData ) . toBeCalledWith ( {
108+ expect ( QueryClientOrigin . prototype . getQueriesData ) . toHaveBeenCalledWith ( {
109109 queryKey : queryKeyUnref ,
110110 } )
111111 } )
@@ -115,7 +115,7 @@ describe('QueryCache', () => {
115115
116116 queryClient . getQueriesData ( { queryKey : queryKeyRef } )
117117
118- expect ( QueryClientOrigin . prototype . getQueriesData ) . toBeCalledWith ( {
118+ expect ( QueryClientOrigin . prototype . getQueriesData ) . toHaveBeenCalledWith ( {
119119 queryKey : queryKeyUnref ,
120120 } )
121121 } )
@@ -129,7 +129,7 @@ describe('QueryCache', () => {
129129 updatedAt : ref ( 3 ) ,
130130 } )
131131
132- expect ( QueryClientOrigin . prototype . setQueryData ) . toBeCalledWith (
132+ expect ( QueryClientOrigin . prototype . setQueryData ) . toHaveBeenCalledWith (
133133 queryKeyUnref ,
134134 fn ,
135135 { updatedAt : 3 } ,
@@ -145,7 +145,7 @@ describe('QueryCache', () => {
145145 updatedAt : ref ( 3 ) ,
146146 } )
147147
148- expect ( QueryClientOrigin . prototype . setQueriesData ) . toBeCalledWith (
148+ expect ( QueryClientOrigin . prototype . setQueriesData ) . toHaveBeenCalledWith (
149149 { queryKey : queryKeyUnref } ,
150150 fn ,
151151 { updatedAt : 3 } ,
@@ -159,7 +159,7 @@ describe('QueryCache', () => {
159159 updatedAt : ref ( 3 ) ,
160160 } )
161161
162- expect ( QueryClientOrigin . prototype . setQueriesData ) . toBeCalledWith (
162+ expect ( QueryClientOrigin . prototype . setQueriesData ) . toHaveBeenCalledWith (
163163 { queryKey : queryKeyUnref } ,
164164 fn ,
165165 { updatedAt : 3 } ,
@@ -173,7 +173,7 @@ describe('QueryCache', () => {
173173
174174 queryClient . getQueryState ( queryKeyRef )
175175
176- expect ( QueryClientOrigin . prototype . getQueryState ) . toBeCalledWith (
176+ expect ( QueryClientOrigin . prototype . getQueryState ) . toHaveBeenCalledWith (
177177 queryKeyUnref ,
178178 )
179179 } )
@@ -187,7 +187,7 @@ describe('QueryCache', () => {
187187 queryKey : queryKeyRef ,
188188 } )
189189
190- expect ( QueryClientOrigin . prototype . removeQueries ) . toBeCalledWith ( {
190+ expect ( QueryClientOrigin . prototype . removeQueries ) . toHaveBeenCalledWith ( {
191191 queryKey : queryKeyUnref ,
192192 } )
193193 } )
@@ -204,7 +204,7 @@ describe('QueryCache', () => {
204204 { cancelRefetch : ref ( false ) } ,
205205 )
206206
207- expect ( QueryClientOrigin . prototype . resetQueries ) . toBeCalledWith (
207+ expect ( QueryClientOrigin . prototype . resetQueries ) . toHaveBeenCalledWith (
208208 {
209209 queryKey : queryKeyUnref ,
210210 } ,
@@ -224,7 +224,7 @@ describe('QueryCache', () => {
224224 { revert : ref ( false ) } ,
225225 )
226226
227- expect ( QueryClientOrigin . prototype . cancelQueries ) . toBeCalledWith (
227+ expect ( QueryClientOrigin . prototype . cancelQueries ) . toHaveBeenCalledWith (
228228 {
229229 queryKey : queryKeyUnref ,
230230 } ,
@@ -244,7 +244,9 @@ describe('QueryCache', () => {
244244 { cancelRefetch : ref ( false ) } ,
245245 )
246246
247- expect ( QueryClientOrigin . prototype . invalidateQueries ) . toBeCalledWith (
247+ expect (
248+ QueryClientOrigin . prototype . invalidateQueries ,
249+ ) . toHaveBeenCalledWith (
248250 {
249251 queryKey : queryKeyUnref ,
250252 refetchType : 'none' ,
@@ -270,12 +272,12 @@ describe('QueryCache', () => {
270272 queryKey : queryKeyRef ,
271273 } )
272274
273- expect ( invalidateQueries ) . toBeCalled ( )
274- expect ( refetchQueries ) . not . toBeCalled ( )
275+ expect ( invalidateQueries ) . toHaveBeenCalled ( )
276+ expect ( refetchQueries ) . not . toHaveBeenCalled ( )
275277
276278 await vi . advanceTimersByTimeAsync ( 0 )
277279
278- expect ( refetchQueries ) . toBeCalled ( )
280+ expect ( refetchQueries ) . toHaveBeenCalled ( )
279281 } )
280282
281283 it ( 'should call invalidateQueries immediately and not call refetchQueries' , async ( ) => {
@@ -295,12 +297,12 @@ describe('QueryCache', () => {
295297 refetchType : 'none' ,
296298 } )
297299
298- expect ( invalidateQueries ) . toBeCalled ( )
299- expect ( refetchQueries ) . not . toBeCalled ( )
300+ expect ( invalidateQueries ) . toHaveBeenCalled ( )
301+ expect ( refetchQueries ) . not . toHaveBeenCalled ( )
300302
301303 await vi . advanceTimersByTimeAsync ( 0 )
302304
303- expect ( refetchQueries ) . not . toBeCalled ( )
305+ expect ( refetchQueries ) . not . toHaveBeenCalled ( )
304306 } )
305307 } )
306308
@@ -315,7 +317,7 @@ describe('QueryCache', () => {
315317 { cancelRefetch : ref ( false ) } ,
316318 )
317319
318- expect ( QueryClientOrigin . prototype . refetchQueries ) . toBeCalledWith (
320+ expect ( QueryClientOrigin . prototype . refetchQueries ) . toHaveBeenCalledWith (
319321 {
320322 queryKey : queryKeyUnref ,
321323 } ,
@@ -332,7 +334,7 @@ describe('QueryCache', () => {
332334 queryKey : queryKeyRef ,
333335 } )
334336
335- expect ( QueryClientOrigin . prototype . fetchQuery ) . toBeCalledWith ( {
337+ expect ( QueryClientOrigin . prototype . fetchQuery ) . toHaveBeenCalledWith ( {
336338 queryKey : queryKeyUnref ,
337339 } )
338340 } )
@@ -344,7 +346,7 @@ describe('QueryCache', () => {
344346
345347 queryClient . prefetchQuery ( { queryKey : queryKeyRef , queryFn : fn } )
346348
347- expect ( QueryClientOrigin . prototype . prefetchQuery ) . toBeCalledWith ( {
349+ expect ( QueryClientOrigin . prototype . prefetchQuery ) . toHaveBeenCalledWith ( {
348350 queryKey : queryKeyUnref ,
349351 queryFn : fn ,
350352 } )
@@ -360,7 +362,9 @@ describe('QueryCache', () => {
360362 initialPageParam : 0 ,
361363 } )
362364
363- expect ( QueryClientOrigin . prototype . fetchInfiniteQuery ) . toBeCalledWith (
365+ expect (
366+ QueryClientOrigin . prototype . fetchInfiniteQuery ,
367+ ) . toHaveBeenCalledWith (
364368 expect . objectContaining ( {
365369 initialPageParam : 0 ,
366370 queryKey : queryKeyUnref ,
@@ -378,7 +382,9 @@ describe('QueryCache', () => {
378382
379383 queryClient . fetchInfiniteQuery ( options )
380384
381- expect ( QueryClientOrigin . prototype . fetchInfiniteQuery ) . toBeCalledWith (
385+ expect (
386+ QueryClientOrigin . prototype . fetchInfiniteQuery ,
387+ ) . toHaveBeenCalledWith (
382388 expect . objectContaining ( {
383389 initialPageParam : 0 ,
384390 queryKey : queryKeyUnref ,
@@ -397,7 +403,9 @@ describe('QueryCache', () => {
397403 initialPageParam : 0 ,
398404 } )
399405
400- expect ( QueryClientOrigin . prototype . prefetchInfiniteQuery ) . toBeCalledWith ( {
406+ expect (
407+ QueryClientOrigin . prototype . prefetchInfiniteQuery ,
408+ ) . toHaveBeenCalledWith ( {
401409 initialPageParam : 0 ,
402410 queryKey : queryKeyUnref ,
403411 queryFn : fn ,
@@ -415,7 +423,9 @@ describe('QueryCache', () => {
415423 } ,
416424 } )
417425
418- expect ( QueryClientOrigin . prototype . setDefaultOptions ) . toBeCalledWith ( {
426+ expect (
427+ QueryClientOrigin . prototype . setDefaultOptions ,
428+ ) . toHaveBeenCalledWith ( {
419429 queries : {
420430 enabled : false ,
421431 } ,
@@ -431,7 +441,7 @@ describe('QueryCache', () => {
431441 enabled : ref ( false ) ,
432442 } )
433443
434- expect ( QueryClientOrigin . prototype . setQueryDefaults ) . toBeCalledWith (
444+ expect ( QueryClientOrigin . prototype . setQueryDefaults ) . toHaveBeenCalledWith (
435445 queryKeyUnref ,
436446 {
437447 enabled : false ,
@@ -446,7 +456,7 @@ describe('QueryCache', () => {
446456
447457 queryClient . getQueryDefaults ( queryKeyRef )
448458
449- expect ( QueryClientOrigin . prototype . getQueryDefaults ) . toBeCalledWith (
459+ expect ( QueryClientOrigin . prototype . getQueryDefaults ) . toHaveBeenCalledWith (
450460 queryKeyUnref ,
451461 )
452462 } )
@@ -460,12 +470,11 @@ describe('QueryCache', () => {
460470 mutationKey : queryKeyRef ,
461471 } )
462472
463- expect ( QueryClientOrigin . prototype . setMutationDefaults ) . toBeCalledWith (
464- queryKeyUnref ,
465- {
466- mutationKey : queryKeyUnref ,
467- } ,
468- )
473+ expect (
474+ QueryClientOrigin . prototype . setMutationDefaults ,
475+ ) . toHaveBeenCalledWith ( queryKeyUnref , {
476+ mutationKey : queryKeyUnref ,
477+ } )
469478 } )
470479 } )
471480
@@ -475,9 +484,9 @@ describe('QueryCache', () => {
475484
476485 queryClient . getMutationDefaults ( queryKeyRef )
477486
478- expect ( QueryClientOrigin . prototype . getMutationDefaults ) . toBeCalledWith (
479- queryKeyUnref ,
480- )
487+ expect (
488+ QueryClientOrigin . prototype . getMutationDefaults ,
489+ ) . toHaveBeenCalledWith ( queryKeyUnref )
481490 } )
482491 } )
483492} )
0 commit comments