(file: string, expected = 200)
| 61 | } |
| 62 | |
| 63 | async function getCode(file: string, expected = 200): Promise<any> { |
| 64 | const res = await request(`/api/filecode/${file}`); |
| 65 | expect(res.type).toBe('application/json; charset=utf-8'); |
| 66 | expect(res.status).toBe(expected); |
| 67 | return JSON.parse(res.body); |
| 68 | } |
| 69 | |
| 70 | function write(root: string, rel: string, body: string): void { |
| 71 | const full = path.join(root, rel); |
no test coverage detected