(responseBody: unknown, calls: FetchCall[])
| 567 | } |
| 568 | |
| 569 | function recordingFetch(responseBody: unknown, calls: FetchCall[]): typeof fetch { |
| 570 | return (async (input: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]) => { |
| 571 | calls.push({ url: fetchInputUrl(input), init: init ?? {} }); |
| 572 | return new Response(JSON.stringify(responseBody), { |
| 573 | status: 200, |
| 574 | headers: { 'content-type': 'application/json' }, |
| 575 | }); |
| 576 | }) as typeof fetch; |
| 577 | } |
| 578 | |
| 579 | function recordingFetchSequence(responseBodies: unknown[], calls: FetchCall[]): typeof fetch { |
| 580 | let index = 0; |
no test coverage detected