diff --git a/src/config.js b/src/config.js index 33cca20..d56fc2a 100644 --- a/src/config.js +++ b/src/config.js @@ -19,8 +19,8 @@ var Config = function() { config_file = ''; // load config from defaults or config file - if (typeof process != 'undefined' && process.env.STREAM_NODE_CONFIG_DIR) { - config_file = process.env.STREAM_NODE_CONFIG_DIR + '/getstream.js'; + if (typeof process != 'undefined' && process.env.STREAM_NODE_CONFIG_PATH) { + config_file = process.cwd() + process.env.STREAM_NODE_CONFIG_PATH; } else { config_file = process.cwd() + '/getstream.js'; } diff --git a/test/index_test.js b/test/index_test.js index 8c2c79d..efc583a 100644 --- a/test/index_test.js +++ b/test/index_test.js @@ -59,12 +59,11 @@ describe('Config', function() { }); describe.skip('Config Env Var', function() { - var configDir = path.join(__dirname, './tmp'); - var configFile = path.join(configDir, 'getstream.js'); + var configFile = '/tmp/getstream.js'; before(function() { this.env = pmock.env({ - STREAM_NODE_CONFIG_DIR: configDir, + STREAM_NODE_CONFIG_PATH: configFile, }); mockery.enable({