import * as glob from "glob" ; import * as path from "path" ; param rootPath param directoryNames param prefix returns export const findBudgieFilesUnder = ( rootPath , directoryNames , prefix = "" ) => { const tests = new Map < string , string [ ] > ( ) ; for ( const childName of directoryNames ) { const directoryPath = path . resolve ( rootPath , childName , prefix ) ; const testFiles = glob . sync ( `${ directoryPath }/**/*.bg` ) . map ( ( testFileName ) => testFileName . substring ( directoryPath . length + 1 , testFileName . indexOf ( ".bg" ) ) ) ; if ( testFiles . length !== 0 ) { tests . set ( childName , testFiles ) ; } } return tests ; } ;