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:
parent
39b5f26f56
commit
0b71d64651
@ -23,11 +23,20 @@ describe('Unit: The health cheack api', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should give 500 when db is failing', (done) => {
|
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
|
request
|
||||||
.get('/health')
|
.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) => {
|
it('should give 200 when db is not failing', (done) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user