(url)
| 66 | function recordingFetch(answer: (url: string) => Response | Error): { fetch: FetchLike; urls: string[] } { |
| 67 | const urls: string[] = []; |
| 68 | const fetchImpl: FetchLike = async (url) => { |
| 69 | urls.push(url); |
| 70 | const result = answer(url); |
| 71 | if (result instanceof Error) { |
| 72 | throw result; |
| 73 | } |
| 74 | return result; |
| 75 | }; |
| 76 | return { fetch: fetchImpl, urls }; |
| 77 | } |
| 78 |
no test coverage detected