Skip to content

Commit

Permalink
fix(tests): allow to override mongodb URL in import-from-prod.js
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienjoly committed Aug 19, 2021
1 parent 478b1e8 commit 1da673f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/import-from-prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ const mongodb = require('mongodb');
const ObjectID = (id) => mongodb.ObjectID.createFromHexString(id);

// Parameters
const url = 'mongodb://localhost:27117';
const dbName = 'openwhyd_test';
const { MONGODB_HOST, MONGODB_PORT, MONGODB_DATABASE } = process.env;
const url = `mongodb://${MONGODB_HOST || 'localhost'}:${MONGODB_PORT || 27117}`;
const dbName = MONGODB_DATABASE || 'openwhyd_test';
const username = process.argv[2] || 'test'; // default profile: https://openwhyd.org/test
const password = {
plain: 'admin',
Expand Down

0 comments on commit 1da673f

Please sign in to comment.