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

queryOptions.test.ts

16 lines526 Bytes

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