Skip to content

Commit 2d3f5b3

Browse files
authored
test(vue-query/queryOptions): add runtime test for identity function (#10222)
1 parent 6717985 commit 2d3f5b3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { queryOptions } from '../queryOptions'
3+
import type { UseQueryOptions } from '../useQuery'
4+
5+
describe('queryOptions', () => {
6+
it('should return the object received as a parameter without any modification.', () => {
7+
const object: UseQueryOptions = {
8+
queryKey: ['key'],
9+
queryFn: () => Promise.resolve(5),
10+
} as const
11+
12+
expect(queryOptions(object)).toBe(object)
13+
})
14+
})

0 commit comments

Comments
 (0)