mirror of https://github.com/embarklabs/embark.git
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 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
|
||||
if (self.options.logging) {
|
||||
cb(logger);
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue