( fn: (input: string | URL, init?: RequestInit) => Response | Promise<Response> )
| 15 | } |
| 16 | |
| 17 | function mockFetch( |
| 18 | fn: (input: string | URL, init?: RequestInit) => Response | Promise<Response> |
| 19 | ): void { |
| 20 | globalThis.fetch = Object.assign(fn, { |
| 21 | preconnect: (_url: string | URL) => { |
| 22 | // no-op in tests |
| 23 | }, |
| 24 | }) as typeof fetch; |
| 25 | } |
| 26 | |
| 27 | function setMockFetchForSuccessfulGithubLogin(login = "octocat"): void { |
| 28 | mockFetch((input) => { |
no outgoing calls
no test coverage detected