diff --git a/server/__tests__/room.test.js b/server/__tests__/room.test.js index 801b092..b7e92ec 100644 --- a/server/__tests__/room.test.js +++ b/server/__tests__/room.test.js @@ -102,6 +102,9 @@ describe('Rooms', () => { const result = await roomRepo.get(roomID); + expect(db.connect).toHaveBeenCalled(); + expect(db.getConnection).toHaveBeenCalled(); + expect(collection.findOne).toHaveBeenCalled(); expect(result.id).toBe("123456"); }); @@ -111,6 +114,9 @@ describe('Rooms', () => { const result = await roomRepo.get(roomID); + expect(db.connect).toHaveBeenCalled(); + expect(db.getConnection).toHaveBeenCalled(); + expect(collection.findOne).toHaveBeenCalled(); expect(result).toBeNull(); }); @@ -126,6 +132,7 @@ describe('Rooms', () => { const result = await roomRepo.getAll(); expect(db.connect).toHaveBeenCalled(); + expect(collection.find).toHaveBeenCalled(); expect(result).toEqual(rooms); });