From d45f76beec1d30ebd0302a4c1305b14eb89e97cf Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 12 Oct 2015 12:25:43 -0400 Subject: [PATCH] read embark config file to get contract files for testing --- bin/embark | 2 +- lib/index.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/embark b/bin/embark index f1bf77449..c160911af 100755 --- a/bin/embark +++ b/bin/embark @@ -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"); diff --git a/lib/index.js b/lib/index.js index e27f4c1c9..cd0a92093 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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; }