1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/test/e2e/health.e2e.test.js
Ivar Conradi Østhus d1fd5d3900 fix: e2e tests should only set up one database per test file (#504)
* fix: e2e tests should only set up one database per test file

* fix: Allow e2e-tests to reset db content
2020-02-20 08:34:29 +01:00

28 lines
632 B
JavaScript

'use strict';
const test = require('ava');
const { setupApp } = require('./helpers/test-helper');
const dbInit = require('./helpers/database-init');
const getLogger = require('../fixtures/no-logger');
let stores;
test.before(async () => {
const db = await dbInit('health_api', getLogger);
stores = db.stores;
});
test.after(async () => {
await stores.db.destroy();
});
test('returns health good', async t => {
t.plan(0);
const request = await setupApp(stores);
return request
.get('/health')
.expect('Content-Type', /json/)
.expect(200)
.expect('{"health":"GOOD"}');
});