From 74b2aeed25fbf4c8bcb4d4ae34044e3d1705db0e Mon Sep 17 00:00:00 2001 From: jw255 Date: Fri, 13 Apr 2018 16:58:06 +0100 Subject: fixed template matching in test suite --- test/integration/protocol.routes.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/integration') diff --git a/test/integration/protocol.routes.test.ts b/test/integration/protocol.routes.test.ts index 866ac2a..ebe18c2 100644 --- a/test/integration/protocol.routes.test.ts +++ b/test/integration/protocol.routes.test.ts @@ -266,14 +266,14 @@ describe('routes : protocol', () => { }); }); forEach(completeProtocol).it( - '%s %s should conform to the general response protocol', + '%s %s should conform to the general response template', (method: string, path: string, temp: Template, resCode: number) => { const request: ChaiHttp.Request = method === 'get' ? chai.request(app).get(base + path) : chai.request(app).post(base + path); request.set('Authorization', `Bearer ${token}`); return request.then((res: ChaiHttp.Response) => { - match(responseTemplate, JSON.parse(res.body)).shoul.be.true; + expect(match(responseTemplate)(res.body)).to.be.true; }); }); forEach(completeProtocol).it( @@ -284,7 +284,7 @@ describe('routes : protocol', () => { .get(base + path) .set('Authorization', `Bearer ${token}`) .then((res: ChaiHttp.Response) => { - expect(match(temp)(JSON.parse(res.body))).to.be.true; + expect(match(temp)(res.body)).to.be.true; }); } else { return true; -- cgit v1.2.1