(responseFactory)
| 90 | } |
| 91 | |
| 92 | function mockFetch(responseFactory) { |
| 93 | const calls = []; |
| 94 | const fn = async (url, opts) => { |
| 95 | calls.push({ url, opts }); |
| 96 | return responseFactory(calls.length, opts); |
| 97 | }; |
| 98 | fn.calls = calls; |
| 99 | return fn; |
| 100 | } |
| 101 | |
| 102 | function responseFromJson({ status = 200, json = {} } = {}) { |
| 103 | return { |
no outgoing calls
no test coverage detected