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

infinite-query-options.test.ts

19 lines631 Bytes

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