const rimraf = require('rimraf')
const mongoose = require('mongoose')
+mongoose.Promise = global.Promise
const constants = require('../../../server/initializers/constants')
const mongodbUrl = 'mongodb://' + constants.CONFIG.DATABASE.HOST + ':' + constants.CONFIG.DATABASE.PORT + '/' + constants.CONFIG.DATABASE.DBNAME
mongoose.connect(mongodbUrl, function () {
console.info('Deleting MongoDB %s database.', constants.CONFIG.DATABASE.DBNAME)
- mongoose.connection.db.dropDatabase(function () {
+ mongoose.connection.dropDatabase(function () {
mongoose.connection.close()
})
})