From 06e315c9ff413fb2d91b1f565bf5bfc9437c26ed Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 4 Nov 2024 17:47:33 +0900 Subject: [PATCH] test(react-query): type test usePrefetchInfiniteQuery correctly (#8223) * test(react-query): type test usePrefetchInfiniteQuery correctly * chore: update --- .../src/__tests__/prefetch.test-d.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/react-query/src/__tests__/prefetch.test-d.tsx b/packages/react-query/src/__tests__/prefetch.test-d.tsx index 93196da0c8..c6cbf1da7e 100644 --- a/packages/react-query/src/__tests__/prefetch.test-d.tsx +++ b/packages/react-query/src/__tests__/prefetch.test-d.tsx @@ -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, }) })