(responseFactory)
| 32 | } |
| 33 | |
| 34 | function mockFetch(responseFactory) { |
| 35 | const calls = []; |
| 36 | const fn = async (url, opts) => { |
| 37 | calls.push({ url, opts }); |
| 38 | return responseFactory(calls.length, url); |
| 39 | }; |
| 40 | fn.calls = calls; |
| 41 | return fn; |
| 42 | } |
| 43 | |
| 44 | // A non-JSON Hub response (WAF challenge page, captive portal, gateway error) |
| 45 | // has no `json()` body the API path can parse. readHubResponseText falls back |
no outgoing calls
no test coverage detected