Commit 05eed06a authored by Juha's avatar Juha

Merge branch 'health-check-path-change' into 'master'

Changed health check path

See merge request !11
parents 71d955aa 4f243ab1
Pipeline #24623448 passed with stage
const request = require('supertest');
const db = require('../models/sequelize');
const app = require('./app');
describe('Auth service API tests', () => {
afterAll(() => {
app.close();
db.sequelize.close();
});
test('Should return a client error for #get /', async () => {
const response = await request(app)
.get('/');
expect(response.statusCode).toBe(404);
expect(response.body.code).toBe('ResourceNotFound');
});
});
/* eslint-disable global-require */
module.exports = function (server) {
require('./health-check')(server);
require('./root')(server);
require('./login')(server);
require('./protected')(server);
};
......@@ -2,15 +2,15 @@ const request = require('supertest');
const db = require('../../../models/sequelize');
const app = require('../../app');
describe('Get /health-check API tests', () => {
describe('Get / API tests', () => {
afterAll(() => {
app.close();
db.sequelize.close();
});
test('Should return success for #get /health-check', async () => {
test('Should return success for #get /', async () => {
const response = await request.agent(app)
.get('/health-check');
.get('/');
expect(response.statusCode).toBe(200);
});
});
......@@ -2,5 +2,5 @@ const restifyAsyncWrap = require('@gilbertco/restify-async-wrap');
const getHealthCheck = require('./get');
module.exports = (server) => {
server.get('/health-check', restifyAsyncWrap(getHealthCheck));
server.get('/', restifyAsyncWrap(getHealthCheck));
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment