(id: string | null)
| 37 | it('should allow undefined response in initialData', () => { |
| 38 | const key = createKey() |
| 39 | const options = (id: string | null) => |
| 40 | queryOptions({ |
| 41 | queryKey: [...key, id], |
| 42 | queryFn: () => |
| 43 | Promise.resolve({ |
| 44 | id: '1', |
| 45 | title: 'Do Laundry', |
| 46 | }), |
| 47 | initialData: () => |
| 48 | !id |
| 49 | ? undefined |
| 50 | : { |
| 51 | id, |
| 52 | title: 'Initial Data', |
| 53 | }, |
| 54 | }) |
| 55 | |
| 56 | expectTypeOf(options(null).initialData).returns.toEqualTypeOf< |
| 57 | { id: string; title: string } | undefined |
no test coverage detected