WIP mongodb-memory-serve

This commit is contained in:
negue
2024-10-29 22:43:03 +01:00
parent 7c9b7be012
commit cce4363319
7 changed files with 562 additions and 22 deletions

View File

@@ -59,6 +59,11 @@ gulp.task('test:prepare:mongo', cb => {
const mongooseOptions = getDefaultConnectionOptions();
const connectionUrl = getDevelopmentConnectionUrl(TEST_DB_URI);
console.info({
mongooseOptions,
connectionUrl,
});
mongoose.connect(connectionUrl, mongooseOptions)
.then(() => mongoose.connection.dropDatabase())
.then(() => mongoose.connection.close()).then(() => {