MCPcopy Index your code
hub / github.com/TanStack/query / testFn

Function testFn

packages/react-query/src/__tests__/queryOptions.test-d.tsx:228–237  ·  view source on GitHub ↗
(id?: string)

Source from the content-addressed store, hash-verified

226
227 it('should allow optional initialData object', () => {
228 const testFn = (id?: string) => {
229 const options = queryOptions({
230 queryKey: ['test'],
231 queryFn: () => Promise.resolve('something string'),
232 initialData: id ? 'initial string' : undefined,
233 })
234 expectTypeOf(options.initialData).toMatchTypeOf<
235 InitialDataFunction<string> | string | undefined
236 >()
237 }
238 testFn('id')
239 testFn()
240 })

Callers 1

Calls 1

queryOptionsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…