diff --git a/lib/core/test.js b/lib/core/test.js index 7f00f8a2..0d01cf55 100644 --- a/lib/core/test.js +++ b/lib/core/test.js @@ -11,9 +11,9 @@ var Config = require('./config.js'); var RunCode = require('./runCode.js'); var TestLogger = require('./test_logger.js'); -var Test = function(_options) { - var options = _options || {}; - var simOptions = options.simulatorOptions || {}; +var Test = function(options) { + this.options = _options || {}; + var simOptions = this.options.simulatorOptions || {}; try { this.sim = require('ethereumjs-testrpc'); @@ -39,12 +39,14 @@ var Test = function(_options) { Test.prototype.deployAll = function(contractsConfig, cb) { var self = this; - var logger = new TestLogger({logLevel: 'debug'}); + var logger = new TestLogger({logLevel: this.options.logLevel || 'debug'}); async.waterfall([ function getConfig(callback) { var config = new Config({env: 'test', logger: logger}); - config.loadConfigFiles({embarkConfig: 'embark.json', interceptLogs: false}); + config.loadConfigFiles({ + interceptLogs: false + }); config.contractsConfig = {contracts: contractsConfig}; callback(null, config); }, @@ -86,7 +88,10 @@ Test.prototype.deployAll = function(contractsConfig, cb) { } self.web3.eth.defaultAccount = accounts[0]; RunCode.doEval(result, self.web3); // jshint ignore:line - cb(); + cb(logger); + } else { + cb(); + } }); }); };