Skip to content

Commit

Permalink
Fix to test as dropDatabase now returns a promise
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Powell committed Feb 4, 2018
1 parent d4b5c5d commit 0bb290f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-env mocha */
(function () {
;(function () {
const mongoose = require('mongoose')
const should = require('should')
const validate = require('..')
Expand Down Expand Up @@ -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 => {
Expand Down

0 comments on commit 0bb290f

Please sign in to comment.