Skip to content

Commit ff2076b

Browse files
committed
test: fix skipToken tests
1 parent c808fbc commit ff2076b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/basic.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ describe('useQuery()', async () => {
5151
const name = ref<string | undefined>(undefined)
5252
const pong = trpc.hello.useQuery(() => (name.value ? { name: name.value } : skipToken))
5353

54-
expect(pong.fetchStatus.value).toStrictEqual('fetching')
55-
await vi.waitUntil(() => pong.fetchStatus.value === 'idle')
54+
expect(pong.fetchStatus.value).toStrictEqual('idle')
5655
expect(pong.data.value).toBeUndefined()
5756

5857
name.value = 'World'
59-
expect(pong.status.value).toStrictEqual('error')
58+
expect(pong.status.value).toStrictEqual('pending')
6059
await vi.waitUntil(() => pong.status.value === 'success')
6160

6261
expect(pong.data.value).toStrictEqual('Hello World!')

0 commit comments

Comments
 (0)