Skip to content

Commit

Permalink
fix(test): use env vars for db connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans Kristian Flaatten committed Jul 1, 2016
1 parent 36bb210 commit 6d6ba74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion test/support/mongo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ const Mongo = function Mongo(uri) {

inherits(Mongo, EventEmitter);

module.exports = new Mongo('mongodb://mongo:27017/test');
const addr = process.env.MONGO_PORT_27017_TCP_ADDR || 'mongo';
const port = process.env.MONGO_PORT_27017_TCP_PORT || '27017';
const db = 'test';

module.exports = new Mongo(`mongodb://${addr}:${port}/${db}`);
5 changes: 4 additions & 1 deletion test/support/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

const Redis = require('ioredis');

module.exports = new Redis(6379, 'redis');
const addr = process.env.MONGO_PORT_27017_TCP_ADDR || 'redis';
const port = process.env.MONGO_PORT_27017_TCP_PORT || '6379';

module.exports = new Redis(port, addr);

0 comments on commit 6d6ba74

Please sign in to comment.