Skip to content

Commit 99562d2

Browse files
test(vue-query): strengthen #8199 regression assertion with explicit TData
Per CodeRabbit feedback: bare assertType(useBasket('fruit')) only verified the call compiled, which would still pass under the old buggy behavior (TQueryKey collapsing to QueryKey, TData inferred as unknown). Lock the regression by asserting the propagated TData explicitly.
1 parent 642e8f1 commit 99562d2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/vue-query/src/__tests__/useQuery.test-d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { assertType, describe, expectTypeOf, it } from 'vitest'
22
import { computed, reactive, ref } from 'vue-demi'
33
import { queryKey, sleep } from '@tanstack/query-test-utils'
44
import { queryOptions, useQuery } from '..'
5-
import type { OmitKeyof, UseQueryOptions } from '..'
5+
import type { OmitKeyof, UseQueryOptions, UseQueryReturnType } from '..'
66

77
describe('useQuery', () => {
88
describe('Config object overload', () => {
@@ -169,7 +169,9 @@ describe('useQuery', () => {
169169
})
170170
}
171171

172-
assertType(useBasket('fruit'))
172+
assertType<UseQueryReturnType<'apple' | 'broccoli', Error>>(
173+
useBasket('fruit'),
174+
)
173175
})
174176
})
175177

0 commit comments

Comments
 (0)