Created
March 28, 2020 15:51
-
-
Save jsmanifest/b0920ee4411a7c919eb7cedd88e4bd5c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findEmptyTests(basepath) { | |
let emptyTests = {} | |
if (isDirectory(basepath)) { | |
const dir = fs.readdirSync(basepath) | |
for (let index = 0; index < dir.length; index++) { | |
const filename = dir[index] | |
const filepath = `${basepath}/${filename}` | |
if (isDirectory(filepath)) { | |
if (filename === '__test__') { | |
const testDir = fs.readdirSync(filepath) | |
if (!hasTest(testDir)) { | |
emptyTests[filepath] = createMissingTestsObject(basepath, testDir) | |
} | |
} else { | |
emptyTests = { ...emptyTests, ...findEmptyTests(filepath) } | |
} | |
} | |
} | |
} | |
return emptyTests | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment