From 84714c6899a733b8f4552bd9cb4ec02a4e69f54f Mon Sep 17 00:00:00 2001 From: 0mkar <0mkar@protonmail.com> Date: Wed, 14 Nov 2018 19:06:25 +0530 Subject: [PATCH] Use gatherContractsFrom to collect contracts in fs.walkSync --- remix-tests/src/index.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/remix-tests/src/index.js b/remix-tests/src/index.js index dfefef5329..7e430bcacf 100644 --- a/remix-tests/src/index.js +++ b/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)