get test config files from embark config
This commit is contained in:
parent
d45f76beec
commit
82b9af2a14
|
@ -71,7 +71,10 @@ Embark = {
|
|||
var embarkConfig = readYaml.sync("./embark.yml");
|
||||
var fileExpression = embarkConfig.contracts || ["app/contracts/**/*.sol", "app/contracts/**/*.se"];
|
||||
var contractFiles = grunt.file.expand(fileExpression);
|
||||
var tests = new Test(contractFiles, 'development');
|
||||
var blockchainFile = embarkConfig.blockchainConfig || 'config/blockchain.yml';
|
||||
var contractFile = embarkConfig.contractsConfig || 'config/contracts.yml';
|
||||
|
||||
var tests = new Test(contractFiles, blockchainFile, contractFile, 'development');
|
||||
|
||||
return tests;
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
var ethersim = require('ethersim');
|
||||
var web3 = require('web3');
|
||||
|
||||
Test = function(contractFiles, _env) {
|
||||
Test = function(contractFiles, blockchainFile, contractFile, _env) {
|
||||
this.env = _env || 'development';
|
||||
this.web3 = web3;
|
||||
this.web3.setProvider(ethersim.web3Provider());
|
||||
this.contractFiles = contractFiles;
|
||||
|
||||
Embark.init(this.web3);
|
||||
Embark.blockchainConfig.loadConfigFile('config/blockchain.yml');
|
||||
Embark.contractsConfig.loadConfigFile('config/contracts.yml');
|
||||
Embark.blockchainConfig.loadConfigFile(blockchainFile);
|
||||
Embark.contractsConfig.loadConfigFile(contractFile);
|
||||
|
||||
Embark.contractsConfig.init(this.contractFiles, this.env);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue