From 431fd608a6945b0fbed932f122af5e6e5c8e8cd8 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sat, 5 Dec 2020 18:52:36 +0100 Subject: [PATCH] sample json validation ref #17 --- src/tests/firsttest.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tests/firsttest.spec.ts b/src/tests/firsttest.spec.ts index 3e67076..13492eb 100644 --- a/src/tests/firsttest.spec.ts +++ b/src/tests/firsttest.spec.ts @@ -12,3 +12,11 @@ describe('GET /', () => { expect(res.status).toEqual(404); }); }); +describe('GET /api/teams', () => { + it('is http 200 && is json', async () => { + const res = await axios.get('http://localhost:4010/api/teams', { validateStatus: undefined }); + console.log(res.headers); + expect(res.status).toEqual(200); + expect(res.headers['content-type']).toContain("application/json") + }); +});