Use gatherContractsFrom to collect contracts in fs.walkSync

pull/7/head
0mkar 6 years ago committed by yann300
parent 25199845d0
commit 4a18d35546
  1. 9
      remix-tests/src/index.js

@ -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) {
}) })
} }
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)

Loading…
Cancel
Save