Skip to content

Commit

Permalink
Merge pull request telefonicaid#90 from jason-fox/feature/mongodb-client
Browse files Browse the repository at this point in the history
Feature/mongodb client
  • Loading branch information
fgalan authored Nov 25, 2020
2 parents 14d26d5 + c6bbd98 commit f18e00a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/tools/mongoDBUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ const async = require('async');
function cleanDb(host, name, callback) {
const url = 'mongodb://' + host + ':27017/' + name;

MongoClient.connect(
url,
function(err, db) {
if (db) {
db.dropDatabase();
/* eslint-disable-next-line no-unused-vars */
MongoClient.connect(url, { useNewUrlParser: true }, function (err, db) {
if (db && db.db()) {
/* eslint-disable-next-line no-unused-vars */
db.db().dropDatabase(function (err, result) {
db.close();
}
callback();
callback();
});
}
);
});
}

function cleanDbs(host, callback) {
Expand Down

0 comments on commit f18e00a

Please sign in to comment.