Skip to content

Commit

Permalink
winstonjs#225: Log currently used MongoDB version in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
curledUpSheep committed Jul 13, 2023
1 parent d8df41d commit 591d805
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/winston-mongodb-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const dbName = process.env.WINSTON_MONGODB_DBNAME
let dbUrl;

async function setUpDb() {
this.timeout(0);

const customDbUrl = process.env.USER_WINSTON_MONGODB_URL
|| process.env.WINSTON_MONGODB_URL;

Expand All @@ -32,7 +34,9 @@ async function setUpDb() {
dbUrl = inMemoryMongo.getUri('winston');
}

mongoose.connect(dbUrl, { useNewUrlParser: true });
await mongoose.connect(dbUrl, { useNewUrlParser: true });
const serverInfo = await mongoose.connection.db.admin().serverInfo();
console.log(`Testing against MongDB version ${serverInfo.version} at URL ${dbUrl}`);
}

before(setUpDb);
Expand Down

0 comments on commit 591d805

Please sign in to comment.