(opts?: { failSet?: boolean })
| 15 | } |
| 16 | |
| 17 | function makeInput(opts?: { failSet?: boolean }) { |
| 18 | const setCalls: Array<Record<string, unknown>> = [] |
| 19 | return { |
| 20 | input: { |
| 21 | client: { |
| 22 | auth: { |
| 23 | set: async (req: Record<string, unknown>) => { |
| 24 | setCalls.push(req) |
| 25 | if (opts?.failSet) throw new Error("auth.set boom") |
| 26 | }, |
| 27 | }, |
| 28 | }, |
| 29 | } as any, |
| 30 | setCalls, |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | function makeServer(handler: (request: Request, url: URL) => Response | Promise<Response>) { |
| 35 | return Bun.serve({ |