(f: typeof fetch)
| 29 | } |
| 30 | |
| 31 | function calledRequest(f: typeof fetch) { |
| 32 | const [url, init] = (f as unknown as Mock<typeof fetch>).mock.calls[0] ?? []; |
| 33 | const h = init?.headers as Record<string, string> | undefined; |
| 34 | return { |
| 35 | url: url as string, |
| 36 | method: init?.method ?? "", |
| 37 | auth: h?.["Authorization"], |
| 38 | }; |
| 39 | } |
| 40 | |
| 41 | function callCount(f: typeof fetch): number { |
| 42 | return (f as unknown as Mock<typeof fetch>).mock.calls.length; |
no outgoing calls
no test coverage detected