File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,24 +10,31 @@ var mocha = new Mocha();
1010const itSpecNameRegex = / (?< = i t \( ' ) ( \d | \w | \s ) + / ig
1111
1212
13+ const filesWithGrepOpts = [ ]
14+
15+
1316
1417var testDir = path . relative ( __dirname , './mocha_specs' )
1518
1619// Add each .js file to the mocha instance
17- getSpecFilesArr ( testDir )
20+ getSpecFilesArr ( testDir ) . forEach ( function ( file ) {
21+
22+ const fileContent = fs . readFileSync ( file , { encoding : 'utf8' } )
1823
24+ const stepGreps = fileContent . match ( itSpecNameRegex )
1925
20- . forEach ( function ( file ) {
2126
22- const fileContent = fs . readFileSync ( file , { encoding : 'utf8' } )
27+ stepGreps . forEach ( function ( grepItem ) {
28+ filesWithGrepOpts . push ( { file, grepItem} )
29+ } )
2330
24- console . log ( fileContent . match ( itSpecNameRegex ) )
31+ // mocha.addFile(
32+ // path.join(testDir, file)
33+ // );
34+ } ) ;
2535
26- // mocha.addFile(
27- // path.join(testDir, file)
28- // );
29- } ) ;
3036
37+ console . log ( filesWithGrepOpts )
3138
3239
3340
You can’t perform that action at this time.
0 commit comments