1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00

fix db test

This commit is contained in:
ivaosthu 2016-11-11 16:36:51 +01:00
parent 5bdaf2cf91
commit 0eeba44db0

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) => {