Merge pull request #225 from DeviateFish/more-testing-options

More testing options
This commit is contained in:
Iuri Matias 2017-02-27 06:57:22 -05:00 committed by GitHub
commit be6da0df2d
1 changed files with 13 additions and 6 deletions

View File

@ -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,15 @@ 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({
embarkConfig: self.options.embarkConfig || 'embark.json',
interceptLogs: false
});
config.contractsConfig = {contracts: contractsConfig};
callback(null, config);
},
@ -86,7 +89,11 @@ Test.prototype.deployAll = function(contractsConfig, cb) {
}
self.web3.eth.defaultAccount = accounts[0];
RunCode.doEval(result, self.web3); // jshint ignore:line
cb();
if (self.options.logging) {
cb(logger);
} else {
cb();
}
});
});
};