(body: unknown, status = 200)
| 48 | }; |
| 49 | |
| 50 | function makeFetch(body: unknown, status = 200): UsageDeps['fetchImpl'] { |
| 51 | return vi.fn( |
| 52 | async () => |
| 53 | new Response(JSON.stringify(body), { |
| 54 | status, |
| 55 | headers: { 'content-type': 'application/json' }, |
| 56 | }), |
| 57 | ) as unknown as UsageDeps['fetchImpl']; |
| 58 | } |
| 59 | |
| 60 | let credentialsPath: string; |
| 61 |