From 6a65711c2f408326bfd860f356f43e2a0e64b8ee Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 31 Oct 2015 10:55:17 -0500 Subject: [PATCH] Close db connections in helpers --- test/helpers/api.helper.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/helpers/api.helper.js b/test/helpers/api.helper.js index dd66edc80a..0383acbe29 100644 --- a/test/helpers/api.helper.js +++ b/test/helpers/api.helper.js @@ -181,6 +181,8 @@ export function resetHabiticaDB() { members: [], }, (err) => { if (err) return reject(err); + + db.close(); resolve(); }); }); @@ -230,6 +232,7 @@ function _updateDocument(collectionName, doc, update, cb) { collection.update({ _id: doc._id }, { $set: update }, (err, result) => { if (err) throw `Error updating ${collectionName}: ${err}`; assign(doc, update); + db.close(); cb(); }); });