File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/toolkit/src/query/tests Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 6
6
setupApiStore ,
7
7
waitMs ,
8
8
} from '../../tests/utils/helpers'
9
+ import { delay } from '../../utils'
9
10
10
11
interface Post {
11
12
id : string
@@ -52,7 +53,7 @@ const api = createApi({
52
53
} ) ,
53
54
post2 : build . query < Post , string > ( {
54
55
queryFn : async ( id ) => {
55
- await waitMs ( 20 )
56
+ await delay ( 20 )
56
57
return {
57
58
data : {
58
59
id,
@@ -276,7 +277,7 @@ describe('upsertQueryData', () => {
276
277
title : 'All about cheese.' ,
277
278
contents : 'Yummy' ,
278
279
}
279
- baseQuery . mockImplementation ( ( ) => waitMs ( 20 ) . then ( ( ) => fetchedData ) )
280
+ baseQuery . mockImplementation ( ( ) => delay ( 20 ) . then ( ( ) => fetchedData ) )
280
281
const upsertedData = {
281
282
id : '3' ,
282
283
title : 'Data from a SSR Render' ,
@@ -299,7 +300,7 @@ describe('upsertQueryData', () => {
299
300
} )
300
301
test ( 'upsert while a normal query is running (rejected)' , async ( ) => {
301
302
baseQuery . mockImplementationOnce ( async ( ) => {
302
- await waitMs ( 20 )
303
+ await delay ( 20 )
303
304
// eslint-disable-next-line no-throw-literal
304
305
throw 'Error!'
305
306
} )
You can’t perform that action at this time.
0 commit comments