Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Export production defaults if not testing module directly

  • Loading branch information...
commit 7e40db2c54603962f9269b5edad5b4ab686beda9 1 parent 7ea199e
Geoff Wagstaff TheDeveloper authored
Showing with 4 additions and 6 deletions.
  1. +4 −6 config.js
10 config.js
View
@@ -1,13 +1,11 @@
var debug = require('debug')('convoy:config');
-// Check for config module. If not existent, export an empty config
try{
var config = require('config');
debug('Loading config from node-config');
- module.exports = config.setModuleDefaults('convoy', require('./config/default'));
+ module.exports = config.setModuleDefaults('convoy', process.env.NODE_ENV == 'test' ? config : require('./config/default'));
}
catch(e){
- debug('Setting config to empty object');
- module.exports = {};
-}
-
+ debug('Setting config to production defaults');
+ module.exports = require('./config/default');
+}
Please sign in to comment.
Something went wrong with that request. Please try again.