Created
March 28, 2020 15:51
-
-
Save jsmanifest/510b1172dd9e5bb3489d0dc52486fed2 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 createMissingTestsObject(str, dir) { | |
const indexToSrc = str.indexOf('src') | |
let category = str.substring(indexToSrc + 4) | |
let subcategory = category.substring(category.indexOf('/') + 1) | |
subcategory = subcategory.substring(0, subcategory.indexOf('/')) | |
category = category.substring(0, category.indexOf('/')) | |
return { | |
name: str.substring(str.lastIndexOf('/') + 1), | |
category, | |
subcategory, | |
totalFiles: dir.length, | |
filesList: dir, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment