Commit 7409c3aa authored by Iuri Matias's avatar Iuri Matias

move determine test contracts into own method in waterfall

parent 3275f1b0
...@@ -18,22 +18,25 @@ var runTestFiles = function(filepath, isDirectory, web3) { ...@@ -18,22 +18,25 @@ var runTestFiles = function(filepath, isDirectory, web3) {
next(err) next(err)
} }
let contractsToTest = [] next(null, compilationResult, contracts)
if (isDirectory) { })
fs.readdirSync(filepath).forEach(filename => { },
if (filename.indexOf('_test.sol') < 0) { function determineTestContractsToRun(compilationResult, contracts, next) {
return let contractsToTest = []
} if (isDirectory) {
Object.keys(compilationResult[path.basename(filename)]).forEach(contractName => { fs.readdirSync(filepath).forEach(filename => {
contractsToTest.push(contractName) if (filename.indexOf('_test.sol') < 0) {
}) return
}
Object.keys(compilationResult[path.basename(filename)]).forEach(contractName => {
contractsToTest.push(contractName)
}) })
} else { })
contractsToTest = Object.keys(compilationResult[path.basename(filepath)]) } else {
} contractsToTest = Object.keys(compilationResult[path.basename(filepath)])
}
next(null, contractsToTest, contracts) next(null, contractsToTest, contracts)
})
}, },
function runTests (contractsToTest, contracts, next) { function runTests (contractsToTest, contracts, next) {
var testCallback = function (result) { var testCallback = function (result) {
......
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