feature/17-automated_tests #21

Merged
niggl merged 56 commits from feature/17-automated_tests into dev 2020-12-10 19:36:08 +00:00
2 changed files with 7 additions and 5 deletions
Showing only changes of commit 39cefbc593 - Show all commits

View File

@ -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")
});

View File

@ -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 () => {