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', () => {
310
310
1 ,
311
311
)
312
312
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 )
316
315
expect ( onSuccess ) . toHaveBeenCalledTimes ( 1 )
317
316
} )
318
317
@@ -376,9 +375,8 @@ describe('mutationCache', () => {
376
375
const unsubscribe = observer . subscribe ( ( ) => undefined )
377
376
observer . mutate ( 1 )
378
377
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 )
382
380
expect ( onSuccess ) . toHaveBeenCalledTimes ( 1 )
383
381
} )
384
382
} )
You can’t perform that action at this time.
0 commit comments