After updating gulp-mocha to latest version 6.0.0 all my tests crashed. mongoose is complaining with MissingSchemaError, all the tests Timeout even after increasing the timer, I cant find whats wrong. It appears setting up Mocha and Mongoose has changed and cant find any resource, I tried with promises/ sync and nothing here is how my old code that worked in gulp-mocha :3.0.1 looked
gulp.task('mocha', () => {
process.env.NODE_CONFIG_DIR = './server/tools/config';
let config = require('configuration')();
const mongooseTools = require("./server/tools/mongoose-tools");
return mongooseTools.connect(config.db)
.then(db => mongooseTools.dropDatabase(db))
.then(() => Promise.all([
new Promise((resolve, reject) => gulp.src(testSuites, {read: false})
.pipe(plugins.mocha({
reporter: 'spec',
exit: true,
checkLeaks: true,
timeout: 10000
}))
.on('error', reject)
.on('end', resolve))
]))
.catch(err => console.log(err))
.then(() => mongooseTools.disconnect());
});