diff --git a/lib/core/test.js b/lib/core/test.js index 34374701c..0ecbcd39f 100644 --- a/lib/core/test.js +++ b/lib/core/test.js @@ -12,7 +12,8 @@ var RunCode = require('./runCode.js'); var TestLogger = require('./test_logger.js'); var Test = function(options) { - this.options = _options || {}; + this.options = options || {}; + this.logger = new TestLogger({logLevel: this.options.logLevel || 'debug'}); var simOptions = this.options.simulatorOptions || {}; try { @@ -39,11 +40,10 @@ var Test = function(options) { Test.prototype.deployAll = function(contractsConfig, cb) { var self = this; - var logger = new TestLogger({logLevel: this.options.logLevel || 'debug'}); async.waterfall([ function getConfig(callback) { - var config = new Config({env: 'test', logger: logger}); + var config = new Config({env: 'test', logger: self.logger}); config.loadConfigFiles({ embarkConfig: self.options.embarkConfig || 'embark.json', interceptLogs: false @@ -55,7 +55,7 @@ Test.prototype.deployAll = function(contractsConfig, cb) { var contractsManager = new ContractsManager({ contractFiles: config.contractsFiles, contractsConfig: config.contractsConfig, - logger: logger, + logger: self.logger, plugins: config.plugins }); contractsManager.build(function() { @@ -66,7 +66,7 @@ Test.prototype.deployAll = function(contractsConfig, cb) { var deploy = new Deploy({ web3: self.web3, contractsManager: contractsManager, - logger: logger, + logger: self.logger, chainConfig: false, env: 'test' }); @@ -89,11 +89,7 @@ Test.prototype.deployAll = function(contractsConfig, cb) { } self.web3.eth.defaultAccount = accounts[0]; RunCode.doEval(result, self.web3); // jshint ignore:line - if (self.options.logging) { - cb(logger); - } else { - cb(); - } + cb(); }); }); };