@@ -22,9 +22,9 @@ describe('mutations', () => {
22
22
let variables
23
23
24
24
const mutation = new MutationObserver ( queryClient , {
25
- mutationFn : async ( vars : unknown ) => {
25
+ mutationFn : ( vars : unknown ) => {
26
26
variables = vars
27
- return vars
27
+ return Promise . resolve ( vars )
28
28
} ,
29
29
} )
30
30
@@ -252,7 +252,7 @@ describe('mutations', () => {
252
252
const onSettled = vi . fn ( )
253
253
254
254
queryClient . setMutationDefaults ( key , {
255
- mutationFn : async ( text : string ) => text ,
255
+ mutationFn : ( text : string ) => Promise . resolve ( text ) ,
256
256
onMutate,
257
257
onSuccess,
258
258
onSettled,
@@ -349,8 +349,8 @@ describe('mutations', () => {
349
349
const onSettled = vi . fn ( )
350
350
351
351
const mutation = new MutationObserver ( queryClient , {
352
- mutationFn : async ( ) => {
353
- return 'update'
352
+ mutationFn : ( ) => {
353
+ return Promise . resolve ( 'update' )
354
354
} ,
355
355
} )
356
356
@@ -365,8 +365,8 @@ describe('mutations', () => {
365
365
const onSettled = vi . fn ( )
366
366
367
367
const mutation = new MutationObserver ( queryClient , {
368
- mutationFn : async ( ) => {
369
- return 'update'
368
+ mutationFn : ( ) => {
369
+ return Promise . resolve ( 'update' )
370
370
} ,
371
371
} )
372
372
@@ -380,9 +380,9 @@ describe('mutations', () => {
380
380
const onSuccess = vi . fn ( )
381
381
382
382
const mutation = new MutationObserver ( queryClient , {
383
- mutationFn : async ( ) => {
383
+ mutationFn : ( ) => {
384
384
sleep ( 100 )
385
- return 'update'
385
+ return Promise . resolve ( 'update' )
386
386
} ,
387
387
onSuccess : ( ) => {
388
388
onSuccess ( 1 )
@@ -392,9 +392,9 @@ describe('mutations', () => {
392
392
void mutation . mutate ( )
393
393
394
394
mutation . setOptions ( {
395
- mutationFn : async ( ) => {
395
+ mutationFn : ( ) => {
396
396
sleep ( 100 )
397
- return 'update'
397
+ return Promise . resolve ( 'update' )
398
398
} ,
399
399
onSuccess : ( ) => {
400
400
onSuccess ( 2 )
0 commit comments