(id?: string)
| 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 | }) |
no test coverage detected
searching dependent graphs…