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

infiniteQueryOptions.test.ts

17 lines640 Bytes

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