read embark config file to get contract files for testing

This commit is contained in:
Iuri Matias 2015-10-12 12:25:43 -04:00
parent d33d986f36
commit d45f76beec
2 changed files with 6 additions and 3 deletions

View File

@ -112,7 +112,7 @@ program.command('spec').description('run tests').action(function() {
var embarkConfig = readYaml.sync("./embark.yml");
if (embarkConfig.type === "grunt") {
run('mocha');
run('mocha test/ --no-timeouts');
}
else {
console.log("command not available in meteor or manual mode yet");

View File

@ -4,6 +4,7 @@ var shelljs_global = require('shelljs/global');
var web3 = require('web3');
var commander = require('commander');
var wrench = require('wrench');
var grunt = require('grunt');
//var Tests = require('./test.js');
var Blockchain = require('./blockchain.js');
@ -67,8 +68,10 @@ Embark = {
release: Release,
initTests: function() {
var files = ["app/contracts/simple_storage.sol"];
var tests = new Test(files, 'development');
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');
return tests;
}