Commit 4f243ab1 authored by Juha's avatar Juha

Changed health check path

parent 71d955aa
Pipeline #24623254 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 */ /* eslint-disable global-require */
module.exports = function (server) { module.exports = function (server) {
require('./health-check')(server); require('./root')(server);
require('./login')(server); require('./login')(server);
require('./protected')(server); require('./protected')(server);
}; };
...@@ -2,15 +2,15 @@ const request = require('supertest'); ...@@ -2,15 +2,15 @@ const request = require('supertest');
const db = require('../../../models/sequelize'); const db = require('../../../models/sequelize');
const app = require('../../app'); const app = require('../../app');
describe('Get /health-check API tests', () => { describe('Get / API tests', () => {
afterAll(() => { afterAll(() => {
app.close(); app.close();
db.sequelize.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) const response = await request.agent(app)
.get('/health-check'); .get('/');
expect(response.statusCode).toBe(200); expect(response.statusCode).toBe(200);
}); });
}); });
...@@ -2,5 +2,5 @@ const restifyAsyncWrap = require('@gilbertco/restify-async-wrap'); ...@@ -2,5 +2,5 @@ const restifyAsyncWrap = require('@gilbertco/restify-async-wrap');
const getHealthCheck = require('./get'); const getHealthCheck = require('./get');
module.exports = (server) => { 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