mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 14:12:40 +00:00
Update dbCheck test
This commit is contained in:
@@ -36,17 +36,9 @@ describe('database check middleware', ()=>{
|
||||
|
||||
mongoose.connection.readyState = 99;
|
||||
|
||||
dbCheck(request, response);
|
||||
expect(()=>{dbCheck(request, response);}).toThrow(new Error('Unable to connect to database'));
|
||||
|
||||
mongoose.connection.readyState = dbState;
|
||||
|
||||
expect(response.status).toHaveBeenLastCalledWith(503);
|
||||
expect(response.send).toHaveBeenLastCalledWith(
|
||||
expect.objectContaining({
|
||||
message : 'Unable to connect to database',
|
||||
state : 99
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('should call next if readystate == 1', ()=>{
|
||||
|
||||
Reference in New Issue
Block a user