Merge branch 'develop' of github.com:iurimatias/embark-framework into develop
This commit is contained in:
commit
e806a14af6
|
@ -11,9 +11,9 @@ var Config = require('./config.js');
|
||||||
var RunCode = require('./runCode.js');
|
var RunCode = require('./runCode.js');
|
||||||
var TestLogger = require('./test_logger.js');
|
var TestLogger = require('./test_logger.js');
|
||||||
|
|
||||||
var Test = function(_options) {
|
var Test = function(options) {
|
||||||
var options = _options || {};
|
this.options = _options || {};
|
||||||
var simOptions = options.simulatorOptions || {};
|
var simOptions = this.options.simulatorOptions || {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.sim = require('ethereumjs-testrpc');
|
this.sim = require('ethereumjs-testrpc');
|
||||||
|
@ -39,12 +39,15 @@ var Test = function(_options) {
|
||||||
|
|
||||||
Test.prototype.deployAll = function(contractsConfig, cb) {
|
Test.prototype.deployAll = function(contractsConfig, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var logger = new TestLogger({logLevel: 'debug'});
|
var logger = new TestLogger({logLevel: this.options.logLevel || 'debug'});
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function getConfig(callback) {
|
function getConfig(callback) {
|
||||||
var config = new Config({env: 'test', logger: logger});
|
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};
|
config.contractsConfig = {contracts: contractsConfig};
|
||||||
callback(null, config);
|
callback(null, config);
|
||||||
},
|
},
|
||||||
|
@ -86,7 +89,11 @@ Test.prototype.deployAll = function(contractsConfig, cb) {
|
||||||
}
|
}
|
||||||
self.web3.eth.defaultAccount = accounts[0];
|
self.web3.eth.defaultAccount = accounts[0];
|
||||||
RunCode.doEval(result, self.web3); // jshint ignore:line
|
RunCode.doEval(result, self.web3); // jshint ignore:line
|
||||||
cb();
|
if (self.options.logging) {
|
||||||
|
cb(logger);
|
||||||
|
} else {
|
||||||
|
cb();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue