( fn: (input: string | URL, init?: RequestInit) => Response | Promise<Response> )
| 47 | |
| 48 | // Helper to mock globalThis.fetch without needing the `preconnect` property. |
| 49 | function mockFetch( |
| 50 | fn: (input: string | URL, init?: RequestInit) => Response | Promise<Response> |
| 51 | ): void { |
| 52 | globalThis.fetch = Object.assign(fn, { |
| 53 | preconnect: (_url: string | URL) => { |
| 54 | // no-op in tests |
| 55 | }, |
| 56 | }) as typeof fetch; |
| 57 | } |
| 58 | |
| 59 | // --------------------------------------------------------------------------- |
| 60 | // Mock dependencies |
no outgoing calls
no test coverage detected