Skip to content

Commit 3f92720

Browse files
committed
test(angular-query-persist-client/withPersistQueryClient): replace 'async/await' with 'sleep().then()' pattern in queryFn and restoreClient
1 parent 914e012 commit 3f92720

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/angular-query-persist-client/src/__tests__/with-persist-query-client.test.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ const createMockErrorPersister = (
5353
// noop
5454
},
5555
async restoreClient() {
56-
await sleep(10)
57-
throw error
56+
return sleep(10).then(() => {
57+
throw error
58+
})
5859
},
5960
removeClient,
6061
},
@@ -273,11 +274,11 @@ describe('withPersistQueryClient', () => {
273274
class Page {
274275
state = injectQuery(() => ({
275276
queryKey: key,
276-
queryFn: async () => {
277-
await sleep(10)
278-
fetched = true
279-
return 'fetched'
280-
},
277+
queryFn: () =>
278+
sleep(10).then(() => {
279+
fetched = true
280+
return 'fetched'
281+
}),
281282
staleTime: Infinity,
282283
}))
283284
_ = effect(() => {

0 commit comments

Comments
 (0)