From d0d050e6c6e8733b677030883ce259f51d1e3eda Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 10 Dec 2020 16:18:23 +0100 Subject: [PATCH] Added basic runner get tests ref #17 --- src/tests/runners/runner_add+get.spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/tests/runners/runner_add+get.spec.ts diff --git a/src/tests/runners/runner_add+get.spec.ts b/src/tests/runners/runner_add+get.spec.ts new file mode 100644 index 0000000..525acbf --- /dev/null +++ b/src/tests/runners/runner_add+get.spec.ts @@ -0,0 +1,19 @@ +import axios from 'axios'; +import { config } from '../../config'; +const base = "http://localhost:" + config.internal_port + +describe('GET /api/runners', () => { + it('basic get should return 200', async () => { + const res = await axios.get(base + '/api/runners'); + expect(res.status).toEqual(200); + expect(res.headers['content-type']).toContain("application/json") + }); +}); +// --------------- +describe('GET /api/runners/0', () => { + it('basic get should return 404', async () => { + const res = await axios.get(base + '/api/runners/0', { validateStatus: undefined }); + expect(res.status).toEqual(404); + expect(res.headers['content-type']).toContain("application/json") + }); +});