* Payloads are read as `any` on purpose: these tests assert the JSON contract * the viewer sees over the wire, so typing them against the server's own * interfaces would only prove the server agrees with itself.
(requestPath: string)
| 78 | * interfaces would only prove the server agrees with itself. |
| 79 | */ |
| 80 | async function getJson(requestPath: string): Promise<any> { |
| 81 | const res = await request(requestPath); |
| 82 | expect(res.headers['content-type']).toBe('application/json; charset=utf-8'); |
| 83 | return JSON.parse(res.body); |
| 84 | } |
| 85 | |
| 86 | async function getStatusAndJson(requestPath: string): Promise<{ status: number; body: any }> { |
| 87 | const res = await request(requestPath); |
no test coverage detected