File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
packages/query-core/src/__tests__ Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -310,9 +310,8 @@ describe('mutationCache', () => {
310310 1 ,
311311 )
312312 expect ( testCache . getAll ( ) ) . toHaveLength ( 1 )
313- await vi . waitFor ( ( ) => {
314- expect ( testCache . getAll ( ) ) . toHaveLength ( 0 )
315- } )
313+ await vi . advanceTimersByTimeAsync ( 10 )
314+ expect ( testCache . getAll ( ) ) . toHaveLength ( 0 )
316315 expect ( onSuccess ) . toHaveBeenCalledTimes ( 1 )
317316 } )
318317
@@ -376,9 +375,8 @@ describe('mutationCache', () => {
376375 const unsubscribe = observer . subscribe ( ( ) => undefined )
377376 observer . mutate ( 1 )
378377 unsubscribe ( )
379- await vi . waitFor ( ( ) => {
380- expect ( queryClient . getMutationCache ( ) . getAll ( ) ) . toHaveLength ( 0 )
381- } )
378+ await vi . advanceTimersByTimeAsync ( 0 )
379+ expect ( queryClient . getMutationCache ( ) . getAll ( ) ) . toHaveLength ( 0 )
382380 expect ( onSuccess ) . toHaveBeenCalledTimes ( 1 )
383381 } )
384382 } )
You can’t perform that action at this time.
0 commit comments