Skip to content

Commit

Permalink
refactor(react-query): removed unnecessary lines in infiniteQueryOpti…
Browse files Browse the repository at this point in the history
…ons test
  • Loading branch information
sungpaks committed Oct 10, 2024
1 parent 44dc4a5 commit 3800783
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,12 @@ describe('infiniteQueryOptions', () => {
const queryOptions = infiniteQueryOptions({
queryKey: ['example'],
queryFn: async () => initialData,
// initialData below errors
initialData: initialData
? () => ({ pages: [initialData], pageParams: [] })
: undefined,
getNextPageParam: () => 1,
initialPageParam: 1,
})
queryOptions.initialData
expectTypeOf(queryOptions.initialData).toMatchTypeOf<
| InitialDataFunction<InfiniteData<{ example: boolean }, number>>
| InfiniteData<{ example: boolean }, number>
Expand All @@ -178,14 +176,12 @@ describe('infiniteQueryOptions', () => {
const queryOptions = infiniteQueryOptions({
queryKey: ['example'],
queryFn: async () => initialData,
// initialData below errors
initialData: initialData
? { pages: [initialData], pageParams: [] }
: undefined,
getNextPageParam: () => 1,
initialPageParam: 1,
})
queryOptions.initialData
expectTypeOf(queryOptions.initialData).toMatchTypeOf<
| InitialDataFunction<InfiniteData<{ example: boolean }, number>>
| InfiniteData<{ example: boolean }, number>
Expand Down

0 comments on commit 3800783

Please sign in to comment.