Commit 94f48140 authored by 0mkar's avatar 0mkar Committed by yann300

Use gatherContractsFrom to collect contracts in fs.walkSync

parent a1dd9dc1
...@@ -153,7 +153,7 @@ var runTestFiles = function (filepath, isDirectory, web3, opts) { ...@@ -153,7 +153,7 @@ var runTestFiles = function (filepath, isDirectory, web3, opts) {
function determineTestContractsToRun (compilationResult, contracts, next) { function determineTestContractsToRun (compilationResult, contracts, next) {
let contractsToTest = [] let contractsToTest = []
let contractsToTestDetails = [] let contractsToTestDetails = []
var gatherContractsFrom = (filename) => { const gatherContractsFrom = (filename) => {
if (filename.indexOf('_test.sol') < 0) { if (filename.indexOf('_test.sol') < 0) {
return return
} }
...@@ -178,12 +178,7 @@ var runTestFiles = function (filepath, isDirectory, web3, opts) { ...@@ -178,12 +178,7 @@ var runTestFiles = function (filepath, isDirectory, web3, opts) {
}) })
} }
fs.walkSync(filepath, foundpath => { fs.walkSync(filepath, foundpath => {
if (foundpath.indexOf('_test.sol') < 0) { gatherContractsFrom(foundpath)
return
}
Object.keys(compilationResult[foundpath]).forEach(contractName => {
contractsToTest.push(contractName)
})
}) })
} else { } else {
gatherContractsFrom(filepath) gatherContractsFrom(filepath)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment