Updated api doc tests to listen on the right endpoint

ref #4
This commit is contained in:
Nicolai Ort 2021-03-03 16:21:11 +01:00
parent ec939e6c11
commit f6a53cc3e4
2 changed files with 12 additions and 11 deletions

View File

@ -12,7 +12,7 @@
"test": "jest",
"test:generate_env": "ts-node ./scripts/create_testenv.ts",
"test:ci": "npm run test:generate_env && npm run test:ci:run",
"test:ci:run": "start-server-and-test dev http://localhost:4010/api/docs/openapi.json test"
"test:ci:run": "start-server-and-test dev http://localhost:4010/docs/openapi.json test"
},
"repository": {
"type": "git",
@ -64,6 +64,7 @@
"@types/jest": "^26.0.20",
"@types/node": "^14.14.22",
"@types/nodemailer": "^6.4.0",
"axios": "^0.21.1",
"cp-cli": "^2.0.0",
"jest": "^26.6.3",
"nodemon": "^2.0.7",

View File

@ -2,33 +2,33 @@ import axios from 'axios';
import { config } from '../config';
const base = "http://localhost:" + config.internal_port
describe('GET /api/docs/openapi.json', () => {
describe('GET /docs/openapi.json', () => {
it('OpenAPI Spec is availdable 200', async () => {
const res = await axios.get(base + '/api/docs/openapi.json');
const res = await axios.get(base + '/docs/openapi.json');
expect(res.status).toEqual(200);
});
});
describe('GET /api/docs/swagger.json', () => {
describe('GET /docs/swagger.json', () => {
it('OpenAPI Spec is availdable 200', async () => {
const res = await axios.get(base + '/api/docs/swagger.json');
const res = await axios.get(base + '/docs/swagger.json');
expect(res.status).toEqual(200);
});
});
describe('GET /api/docs/swaggerui', () => {
describe('GET /docs/swaggerui', () => {
it('swaggerui is availdable 200', async () => {
const res = await axios.get(base + '/api/docs/swaggerui');
const res = await axios.get(base + '/docs/swaggerui');
expect(res.status).toEqual(200);
});
});
describe('GET /api/docs/redoc', () => {
describe('GET /docs/redoc', () => {
it('redoc is availdable 200', async () => {
const res = await axios.get(base + '/api/docs/redoc');
const res = await axios.get(base + '/docs/redoc');
expect(res.status).toEqual(200);
});
});
describe('GET /api/docs/rapidoc', () => {
describe('GET /docs/rapidoc', () => {
it('rapidoc is availdable 200', async () => {
const res = await axios.get(base + '/api/docs/rapidoc');
const res = await axios.get(base + '/docs/rapidoc');
expect(res.status).toEqual(200);
});
});