(responses)
| 71 | let mockResponses = []; |
| 72 | |
| 73 | function setupFetch(responses) { |
| 74 | capturedRequests = []; |
| 75 | mockResponses = [...responses]; |
| 76 | globalThis.fetch = async (url, options) => { |
| 77 | capturedRequests.push({ url, options }); |
| 78 | const resp = mockResponses.shift(); |
| 79 | if (!resp) throw new Error("No mock response configured"); |
| 80 | return resp; |
| 81 | }; |
| 82 | } |
| 83 | |
| 84 | function teardownFetch() { |
| 85 | delete globalThis.fetch; |
no outgoing calls
no test coverage detected
searching dependent graphs…