(body: Record<string, unknown>, status = 200)
| 16 | } |
| 17 | |
| 18 | const responseJson = (body: Record<string, unknown>, status = 200): Response => |
| 19 | new Response(JSON.stringify(body), { |
| 20 | status, |
| 21 | headers: { "content-type": "application/json" }, |
| 22 | }); |
| 23 | |
| 24 | const installFetch = (handler: (url: string, init: RequestInit | undefined) => Response) => { |
| 25 | globalThis.fetch = ((input: RequestInfo | URL, init?: RequestInit) => { |