Use gatherContractsFrom to collect contracts in fs.walkSync

pull/7/head
0mkar 6 years ago committed by yann300
parent a1dd9dc18f
commit 94f4814008
  1. 9
      remix-tests/src/index.js

@ -153,7 +153,7 @@ var runTestFiles = function (filepath, isDirectory, web3, opts) {
function determineTestContractsToRun (compilationResult, contracts, next) {
let contractsToTest = []
let contractsToTestDetails = []
var gatherContractsFrom = (filename) => {
const gatherContractsFrom = (filename) => {
if (filename.indexOf('_test.sol') < 0) {
return
}
@ -178,12 +178,7 @@ var runTestFiles = function (filepath, isDirectory, web3, opts) {
})
}
fs.walkSync(filepath, foundpath => {
if (foundpath.indexOf('_test.sol') < 0) {
return
}
Object.keys(compilationResult[foundpath]).forEach(contractName => {
contractsToTest.push(contractName)
})
gatherContractsFrom(foundpath)
})
} else {
gatherContractsFrom(filepath)

Loading…
Cancel
Save