diff --git a/packages/react-query-4/src/usePrefetchInfiniteQuery.test-d.tsx b/packages/react-query-4/src/usePrefetchInfiniteQuery.test-d.tsx new file mode 100644 index 000000000..7acc4255f --- /dev/null +++ b/packages/react-query-4/src/usePrefetchInfiniteQuery.test-d.tsx @@ -0,0 +1,14 @@ +import { infiniteQueryOptions } from './infiniteQueryOptions' +import { queryFn, queryKey } from './test-utils' +import { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery' + +describe('usePrefetchInfiniteQuery', () => { + it('type check', () => { + expectTypeOf(usePrefetchInfiniteQuery({ queryFn, queryKey })) + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + .toEqualTypeOf() + expectTypeOf(usePrefetchInfiniteQuery(infiniteQueryOptions({ queryFn, queryKey }))) + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + .toEqualTypeOf() + }) +}) diff --git a/packages/react-query-4/src/usePrefetchQuery.test-d.tsx b/packages/react-query-4/src/usePrefetchQuery.test-d.tsx new file mode 100644 index 000000000..71f54cfe4 --- /dev/null +++ b/packages/react-query-4/src/usePrefetchQuery.test-d.tsx @@ -0,0 +1,14 @@ +import { queryOptions } from './queryOptions' +import { queryFn, queryKey } from './test-utils' +import { usePrefetchQuery } from './usePrefetchQuery' + +describe('usePrefetchQuery', () => { + it('type check', () => { + expectTypeOf(usePrefetchQuery({ queryFn, queryKey })) + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + .toEqualTypeOf() + expectTypeOf(usePrefetchQuery(queryOptions({ queryFn, queryKey }))) + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + .toEqualTypeOf() + }) +})