(controller: GraphiQLController, specFileName: string)
| 34 | }); |
| 35 | |
| 36 | async function compareSpecAndTemplate(controller: GraphiQLController, specFileName: string) { |
| 37 | const expected = readFileSync(join(process.cwd(), 'specs', specFileName), 'utf8'); |
| 38 | |
| 39 | const ctx = new Context({ path: 'graphql/' }); |
| 40 | const response = await controller.index(ctx); |
| 41 | if (!isHttpResponseOK(response)) { |
| 42 | throw new Error('GraphiQLController.index should have returned a HttpResponseOK instance.'); |
| 43 | } |
| 44 | const actual = response.body; |
| 45 | |
| 46 | strictEqual(actual, expected); |
| 47 | } |
| 48 | |
| 49 | it('should render the HTML template.', async () => { |
| 50 | const controller = new GraphiQLController(); |
no test coverage detected