@@ -35,7 +35,7 @@ describe('queryClient', () => {
35
35
} )
36
36
37
37
describe ( 'defaultOptions' , ( ) => {
38
- test ( 'should merge defaultOptions' , async ( ) => {
38
+ test ( 'should merge defaultOptions' , ( ) => {
39
39
const key = queryKey ( )
40
40
41
41
const queryFn = ( ) => 'data'
@@ -61,7 +61,7 @@ describe('queryClient', () => {
61
61
expect ( newQuery ?. options . gcTime ) . toBe ( Infinity )
62
62
} )
63
63
64
- test ( 'should get defaultOptions' , async ( ) => {
64
+ test ( 'should get defaultOptions' , ( ) => {
65
65
const queryFn = ( ) => 'data'
66
66
const defaultOptions = { queries : { queryFn } }
67
67
const testClient = createQueryClient ( {
@@ -72,7 +72,7 @@ describe('queryClient', () => {
72
72
} )
73
73
74
74
describe ( 'setQueryDefaults' , ( ) => {
75
- test ( 'should not trigger a fetch' , async ( ) => {
75
+ test ( 'should not trigger a fetch' , ( ) => {
76
76
const key = queryKey ( )
77
77
queryClient . setQueryDefaults ( key , { queryFn : ( ) => 'data' } )
78
78
const data = queryClient . getQueryData ( key )
@@ -111,7 +111,7 @@ describe('queryClient', () => {
111
111
expect ( status ) . toBe ( 'error' )
112
112
} )
113
113
114
- test ( 'should also set defaults for observers' , async ( ) => {
114
+ test ( 'should also set defaults for observers' , ( ) => {
115
115
const key = queryKey ( )
116
116
queryClient . setQueryDefaults ( key , {
117
117
queryFn : ( ) => 'data' ,
@@ -124,7 +124,7 @@ describe('queryClient', () => {
124
124
expect ( observer . getCurrentResult ( ) . fetchStatus ) . toBe ( 'idle' )
125
125
} )
126
126
127
- test ( 'should update existing query defaults' , async ( ) => {
127
+ test ( 'should update existing query defaults' , ( ) => {
128
128
const key = queryKey ( )
129
129
const queryOptions1 = { queryFn : ( ) => 'data' }
130
130
const queryOptions2 = { retry : false }
@@ -133,7 +133,7 @@ describe('queryClient', () => {
133
133
expect ( queryClient . getQueryDefaults ( key ) ) . toMatchObject ( queryOptions2 )
134
134
} )
135
135
136
- test ( 'should merge defaultOptions' , async ( ) => {
136
+ test ( 'should merge defaultOptions' , ( ) => {
137
137
const key = queryKey ( )
138
138
139
139
queryClient . setQueryDefaults ( [ ...key , 'todo' ] , { suspense : true } )
@@ -148,7 +148,7 @@ describe('queryClient', () => {
148
148
} )
149
149
150
150
describe ( 'defaultQueryOptions' , ( ) => {
151
- test ( 'should default networkMode when persister is present' , async ( ) => {
151
+ test ( 'should default networkMode when persister is present' , ( ) => {
152
152
expect (
153
153
createQueryClient ( {
154
154
defaultOptions : {
@@ -160,7 +160,7 @@ describe('queryClient', () => {
160
160
) . toBe ( 'offlineFirst' )
161
161
} )
162
162
163
- test ( 'should not default networkMode without persister' , async ( ) => {
163
+ test ( 'should not default networkMode without persister' , ( ) => {
164
164
expect (
165
165
createQueryClient ( {
166
166
defaultOptions : {
@@ -172,7 +172,7 @@ describe('queryClient', () => {
172
172
) . toBe ( undefined )
173
173
} )
174
174
175
- test ( 'should not default networkMode when already present' , async ( ) => {
175
+ test ( 'should not default networkMode when already present' , ( ) => {
176
176
expect (
177
177
createQueryClient ( {
178
178
defaultOptions : {
@@ -642,7 +642,7 @@ describe('queryClient', () => {
642
642
await expect (
643
643
queryClient . fetchQuery ( {
644
644
queryKey : key ,
645
- queryFn : async ( ) : Promise < unknown > => {
645
+ queryFn : ( ) : Promise < unknown > => {
646
646
throw new Error ( 'error' )
647
647
} ,
648
648
} ) ,
@@ -923,7 +923,7 @@ describe('queryClient', () => {
923
923
924
924
const result = await queryClient . prefetchQuery ( {
925
925
queryKey : key ,
926
- queryFn : async ( ) : Promise < unknown > => {
926
+ queryFn : ( ) : Promise < unknown > => {
927
927
throw new Error ( 'error' )
928
928
} ,
929
929
retry : false ,
@@ -937,7 +937,7 @@ describe('queryClient', () => {
937
937
938
938
await queryClient . prefetchQuery ( {
939
939
queryKey : key ,
940
- queryFn : async ( ) => 'data' ,
940
+ queryFn : ( ) => 'data' ,
941
941
gcTime : 10 ,
942
942
} )
943
943
expect ( queryCache . find ( { queryKey : key } ) ) . toBeDefined ( )
@@ -973,7 +973,7 @@ describe('queryClient', () => {
973
973
const key3 = queryKey ( )
974
974
await queryClient . fetchQuery ( {
975
975
queryKey : key1 ,
976
- queryFn : async ( ) => 'data' ,
976
+ queryFn : ( ) => 'data' ,
977
977
} )
978
978
try {
979
979
await queryClient . fetchQuery ( {
@@ -1023,7 +1023,7 @@ describe('queryClient', () => {
1023
1023
const key1 = queryKey ( )
1024
1024
await queryClient . fetchQuery ( {
1025
1025
queryKey : key1 ,
1026
- queryFn : async ( ) => 'data' ,
1026
+ queryFn : ( ) => 'data' ,
1027
1027
} )
1028
1028
queryClient . fetchQuery ( {
1029
1029
queryKey : key1 ,
@@ -2029,7 +2029,7 @@ describe('queryClient', () => {
2029
2029
onlineManager . setOnline ( true )
2030
2030
} )
2031
2031
2032
- test ( 'should not notify queryCache and mutationCache after multiple mounts/unmounts' , async ( ) => {
2032
+ test ( 'should not notify queryCache and mutationCache after multiple mounts/unmounts' , ( ) => {
2033
2033
const testClient = createQueryClient ( )
2034
2034
testClient . mount ( )
2035
2035
testClient . mount ( )
0 commit comments