MCPcopy
hub / github.com/FoalTS/foal / compareSpecAndTemplate

Function compareSpecAndTemplate

packages/graphiql/src/graphiql.controller.spec.ts:36–47  ·  view source on GitHub ↗
(controller: GraphiQLController, specFileName: string)

Source from the content-addressed store, hash-verified

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();

Callers 1

Calls 3

isHttpResponseOKFunction · 0.90
joinFunction · 0.85
indexMethod · 0.45

Tested by

no test coverage detected