|
@@ -10,12 +10,12 @@ const DEFAULT_ENV = 'saas'
|
|
|
|
|
|
|
|
module.exports = {
|
|
module.exports = {
|
|
|
initialize() {
|
|
initialize() {
|
|
|
- before(waitForDb)
|
|
|
|
|
|
|
+ before('wait for db', waitForDb)
|
|
|
if (process.env.CLEANUP_MONGO === 'true') {
|
|
if (process.env.CLEANUP_MONGO === 'true') {
|
|
|
- before(dropTestDatabase)
|
|
|
|
|
|
|
+ before('drop test database', dropTestDatabase)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- before(function (done) {
|
|
|
|
|
|
|
+ before('run migrations', function (done) {
|
|
|
const args = [
|
|
const args = [
|
|
|
'run',
|
|
'run',
|
|
|
'migrations',
|
|
'migrations',
|
|
@@ -32,7 +32,7 @@ module.exports = {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- afterEach(async function () {
|
|
|
|
|
|
|
+ afterEach('purge mongo data', async function () {
|
|
|
return Promise.all(
|
|
return Promise.all(
|
|
|
Object.values(db).map(async collection => {
|
|
Object.values(db).map(async collection => {
|
|
|
if (collection === db.migrations) {
|
|
if (collection === db.migrations) {
|