Skip to content

chore(svelte-query): Tweak provider tests #7794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: pr

on:
pull_request:
push:
branches: ['svelte-5-adapter']

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
queryKey: ['test'],
queryFn: async () => {
states.update((s) => [...s, 'fetching'])
await sleep(10)
await sleep(5)
states.update((s) => [...s, 'fetched'])
return 'fetched'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
queryKey: ['test'],
queryFn: async () => {
fetched.set(true)
await sleep(10)
await sleep(5)
return 'fetched'
},

Expand All @@ -21,5 +21,5 @@
$: states.update((prev) => [...prev, $query])
</script>

<div>data: {$query.data ?? 'null'}</div>
<div>data: {$query.data ?? 'undefined'}</div>
<div>fetchStatus: {$query.fetchStatus}</div>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const query = createQuery({
queryKey: ['test'],
queryFn: async () => {
await sleep(10)
await sleep(5)
return 'fetched'
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const query = createQuery({
queryKey: ['test'],
queryFn: async () => {
await sleep(10)
await sleep(5)
return 'fetched'
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const createMockPersister = (): Persister => {
storedState = persistClient
},
async restoreClient() {
await sleep(10)
await sleep(5)
return storedState
},
removeClient() {
Expand All @@ -46,7 +46,7 @@ const createMockErrorPersister = (
// noop
},
async restoreClient() {
await sleep(10)
await sleep(5)
throw error
},
removeClient,
Expand Down Expand Up @@ -247,7 +247,7 @@ describe('PersistQueryClientProvider', () => {
},
})

await waitFor(() => rendered.getByText('data: null'))
await waitFor(() => rendered.getByText('data: undefined'))
await waitFor(() => rendered.getByText('data: hydrated'))

const states = get(statesStore)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const query = createQuery({
queryKey: ['test'],
queryFn: async () => {
await sleep(10)
await sleep(5)
return 'fetched'
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const query = createQuery({
queryKey: ['test'],
queryFn: async () => {
await sleep(10)
await sleep(5)
return 'fetched'
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
queryKey: ['test'],
queryFn: async (): Promise<string> => {
await sleep(10)
await sleep(5)
return 'fetched'
},
},
Expand Down
Loading