From fc63f13f0060cbcdbda809cec2bfb2af34365ddf Mon Sep 17 00:00:00 2001 From: carlospelazas Date: Mon, 6 May 2024 11:30:25 +0200 Subject: [PATCH] fix mongo error on tests --- game/qgservice/qg-service.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/game/qgservice/qg-service.js b/game/qgservice/qg-service.js index 72b41bad..4d0700ee 100644 --- a/game/qgservice/qg-service.js +++ b/game/qgservice/qg-service.js @@ -26,4 +26,8 @@ const server = app.listen(port, () => { console.log(`Question generator Service listening at http://localhost:${port}`); }); +server.on('close', () => { + mongoose.connection.close(); +}); + module.exports = server;