From 6c9e3f318cfc5c0a89eb90c38231fe0ec4abb8df Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Wed, 13 Nov 2024 16:05:17 +0900 Subject: [PATCH] test(react-query): add test case for queryOptions (#8267) * test(react-query): add test case for queryOptions * chore: update --- .../src/__tests__/queryOptions.test.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 packages/react-query/src/__tests__/queryOptions.test.tsx diff --git a/packages/react-query/src/__tests__/queryOptions.test.tsx b/packages/react-query/src/__tests__/queryOptions.test.tsx new file mode 100644 index 0000000000..28e539690b --- /dev/null +++ b/packages/react-query/src/__tests__/queryOptions.test.tsx @@ -0,0 +1,14 @@ +import { describe, expect, it } from 'vitest' +import { queryOptions } from '../queryOptions' +import type { UseQueryOptions } from '../types' + +describe('queryOptions', () => { + it('should return the object received as a parameter without any modification.', () => { + const object: UseQueryOptions = { + queryKey: ['key'], + queryFn: () => Promise.resolve(5), + } as const + + expect(queryOptions(object)).toStrictEqual(object) + }) +})