Skip to content

Commit 67ab070

Browse files
minseong0324TkDodo
andauthored
test(query-core): resolve ESLint typescript-eslint/require-await warnings (#8900)
Co-authored-by: Dominik Dorfmeister <[email protected]>
1 parent 069cf07 commit 67ab070

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/query-core/src/__tests__/mutations.test.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ describe('mutations', () => {
2222
let variables
2323

2424
const mutation = new MutationObserver(queryClient, {
25-
mutationFn: async (vars: unknown) => {
25+
mutationFn: (vars: unknown) => {
2626
variables = vars
27-
return vars
27+
return Promise.resolve(vars)
2828
},
2929
})
3030

@@ -252,7 +252,7 @@ describe('mutations', () => {
252252
const onSettled = vi.fn()
253253

254254
queryClient.setMutationDefaults(key, {
255-
mutationFn: async (text: string) => text,
255+
mutationFn: (text: string) => Promise.resolve(text),
256256
onMutate,
257257
onSuccess,
258258
onSettled,
@@ -349,8 +349,8 @@ describe('mutations', () => {
349349
const onSettled = vi.fn()
350350

351351
const mutation = new MutationObserver(queryClient, {
352-
mutationFn: async () => {
353-
return 'update'
352+
mutationFn: () => {
353+
return Promise.resolve('update')
354354
},
355355
})
356356

@@ -365,8 +365,8 @@ describe('mutations', () => {
365365
const onSettled = vi.fn()
366366

367367
const mutation = new MutationObserver(queryClient, {
368-
mutationFn: async () => {
369-
return 'update'
368+
mutationFn: () => {
369+
return Promise.resolve('update')
370370
},
371371
})
372372

@@ -380,9 +380,9 @@ describe('mutations', () => {
380380
const onSuccess = vi.fn()
381381

382382
const mutation = new MutationObserver(queryClient, {
383-
mutationFn: async () => {
383+
mutationFn: () => {
384384
sleep(100)
385-
return 'update'
385+
return Promise.resolve('update')
386386
},
387387
onSuccess: () => {
388388
onSuccess(1)
@@ -392,9 +392,9 @@ describe('mutations', () => {
392392
void mutation.mutate()
393393

394394
mutation.setOptions({
395-
mutationFn: async () => {
395+
mutationFn: () => {
396396
sleep(100)
397-
return 'update'
397+
return Promise.resolve('update')
398398
},
399399
onSuccess: () => {
400400
onSuccess(2)

0 commit comments

Comments
 (0)