2021-08-12 15:04:37 +02:00
|
|
|
import { setupApp } from './helpers/test-helper';
|
|
|
|
import dbInit from './helpers/database-init';
|
|
|
|
import getLogger from '../fixtures/no-logger';
|
2019-10-03 15:01:33 +02:00
|
|
|
|
|
|
|
let stores;
|
2021-03-19 22:25:21 +01:00
|
|
|
let db;
|
2019-10-03 15:01:33 +02:00
|
|
|
|
2021-05-28 11:10:24 +02:00
|
|
|
beforeAll(async () => {
|
2021-03-19 22:25:21 +01:00
|
|
|
db = await dbInit('health_api', getLogger);
|
2019-10-03 15:01:33 +02:00
|
|
|
stores = db.stores;
|
|
|
|
});
|
|
|
|
|
2021-05-28 11:10:24 +02:00
|
|
|
afterAll(async () => {
|
2021-03-19 22:25:21 +01:00
|
|
|
await db.destroy();
|
2019-10-03 15:01:33 +02:00
|
|
|
});
|
2016-11-10 21:15:16 +01:00
|
|
|
|
2021-05-28 11:10:24 +02:00
|
|
|
test('returns health good', async () => {
|
|
|
|
expect.assertions(0);
|
|
|
|
const { request, destroy } = await setupApp(stores);
|
|
|
|
await request
|
2017-06-28 10:20:22 +02:00
|
|
|
.get('/health')
|
2016-11-13 15:41:35 +01:00
|
|
|
.expect('Content-Type', /json/)
|
|
|
|
.expect(200)
|
2019-10-03 15:01:33 +02:00
|
|
|
.expect('{"health":"GOOD"}');
|
2021-05-28 11:10:24 +02:00
|
|
|
await destroy();
|
2016-04-24 22:41:37 +02:00
|
|
|
});
|