From 0bb290fd6c4e347a15e93d08299e80739b130049 Mon Sep 17 00:00:00 2001 From: Lee Powell Date: Sun, 4 Feb 2018 08:15:01 +0000 Subject: [PATCH] Fix to test as dropDatabase now returns a promise --- test/test.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/test.js b/test/test.js index f46d259..bcaf93c 100644 --- a/test/test.js +++ b/test/test.js @@ -1,5 +1,5 @@ /* eslint-env mocha */ -(function () { +;(function () { const mongoose = require('mongoose') const should = require('should') const validate = require('..') @@ -82,9 +82,15 @@ }) after(done => { - mongoose.connection.db.dropDatabase() - mongoose.disconnect() - done() + mongoose.connection.db + .dropDatabase() + .catch(err => { + console.dir(err) + }) + .then(() => { + mongoose.disconnect() + done() + }) }) beforeEach(done => {