diff --git a/src/tests/firsttest.spec.ts b/src/tests/firsttest.spec.ts index 13492eb..27c84d3 100644 --- a/src/tests/firsttest.spec.ts +++ b/src/tests/firsttest.spec.ts @@ -1,21 +1,22 @@ import axios from 'axios'; +import { config } from '../config'; +const base = "http://localhost:" + config.internal_port describe('GET /api/openapi.json', () => { it('is http 200', async () => { - const res = await axios.get('http://localhost:4010/api/openapi.json'); + const res = await axios.get(base + '/api/openapi.json'); expect(res.status).toEqual(200); }); }); describe('GET /', () => { it('is http 404', async () => { - const res = await axios.get('http://localhost:4010/', { validateStatus: undefined }); + const res = await axios.get(base + '/', { validateStatus: undefined }); 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); + const res = await axios.get(base + '/api/teams', { validateStatus: undefined }); expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json") }); diff --git a/src/tests/tracks.spec.ts b/src/tests/tracks.spec.ts index 3f8312a..b29294c 100644 --- a/src/tests/tracks.spec.ts +++ b/src/tests/tracks.spec.ts @@ -1,5 +1,6 @@ import axios from 'axios'; -const base = "http://localhost:4010" +import { config } from '../config'; +const base = "http://localhost:" + config.internal_port describe('GET /api/tracks', () => { it('basic get should return 200', async () => {