(instance: Instance, requestPath: string, expected = 200)
| 73 | } |
| 74 | |
| 75 | async function getJson(instance: Instance, requestPath: string, expected = 200): Promise<any> { |
| 76 | const res = await request(instance.server.port, requestPath); |
| 77 | expect(res.type).toBe('application/json; charset=utf-8'); |
| 78 | expect(res.status).toBe(expected); |
| 79 | return JSON.parse(res.body); |
| 80 | } |
| 81 | |
| 82 | async function serve(root: string, dir: string, cg: CodeGraph): Promise<Instance> { |
| 83 | const api = createGraphApi({ projectRoot: root }); |
no test coverage detected