Skip to content

Commit

Permalink
test(react-query): type test usePrefetchInfiniteQuery correctly (#8223)
Browse files Browse the repository at this point in the history
* test(react-query): type test usePrefetchInfiniteQuery correctly

* chore: update
  • Loading branch information
manudeli authored Nov 4, 2024
1 parent aa92acc commit 06e315c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/react-query/src/__tests__/prefetch.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,30 @@ describe('useInfinitePrefetchQuery', () => {
})

it('should not allow refetchInterval, enabled or throwOnError options', () => {
usePrefetchQuery({
usePrefetchInfiniteQuery({
queryKey: ['key'],
queryFn: () => Promise.resolve(5),
// @ts-expect-error TS2345
initialPageParam: 1,
getNextPageParam: () => 1,
// @ts-expect-error TS2353
refetchInterval: 1000,
})

usePrefetchQuery({
usePrefetchInfiniteQuery({
queryKey: ['key'],
queryFn: () => Promise.resolve(5),
// @ts-expect-error TS2345
initialPageParam: 1,
getNextPageParam: () => 1,
// @ts-expect-error TS2353
enabled: true,
})

usePrefetchQuery({
usePrefetchInfiniteQuery({
queryKey: ['key'],
queryFn: () => Promise.resolve(5),
// @ts-expect-error TS2345
initialPageParam: 1,
getNextPageParam: () => 1,
// @ts-expect-error TS2353
throwOnError: true,
})
})
Expand Down

0 comments on commit 06e315c

Please sign in to comment.