1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix db test

This commit is contained in:
ivaosthu 2016-11-11 16:36:51 +01:00 committed by Ivar Conradi Østhus
parent 39b5f26f56
commit 0b71d64651

View File

@ -23,11 +23,20 @@ describe('Unit: The health cheack api', () => {
});
it('should give 500 when db is failing', (done) => {
db.select = () => from = () => Promise.reject();
db.select = () => {
return {
from: () => Promise.reject(new Error('db error'))
}
}
request
.get('/health')
.expect(500, done);
.expect(500)
.end((err, res) => {
assert.equal(res.status, 500)
assert.equal(res.body.health, 'BAD');
done();
});
});
it('should give 200 when db is not failing', (done) => {