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(); }); });