Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

infiniteQueryOptions.test.tsx

19 lines625 Bytes

1import { createKey } from '@tanstack/query-test-utils'
2import { describe, expect, it } from 'vitest'
3​
4import { infiniteQueryOptions } from '../infiniteQueryOptions'
5import type { UseInfiniteQueryOptions } from '../types'
6​
7describe('infiniteQueryOptions', () => {
8 it('should return the object received as a parameter without any modification.', () => {
9 const key = createKey()
10 const object: UseInfiniteQueryOptions = {
11 queryKey: key,
12 queryFn: () => Promise.resolve(5),
13 getNextPageParam: () => null,
14 initialPageParam: null,
15 }
16​
17 expect(infiniteQueryOptions(object)).toBe(object)
18 })
19})