From d6a7d0272af704552aa80f6852e013ba87e05174 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 2 Sep 2025 21:08:15 +1200 Subject: [PATCH] Update dbCheck test --- server/middleware/dbCheck.spec.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/server/middleware/dbCheck.spec.js b/server/middleware/dbCheck.spec.js index c4482a54a..dea218918 100644 --- a/server/middleware/dbCheck.spec.js +++ b/server/middleware/dbCheck.spec.js @@ -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', ()=>{