File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ package-lock.json
44ex.js
55spa-report
66.idea
7+ playground.js
Original file line number Diff line number Diff line change 1+ с
Original file line number Diff line number Diff line change 1- console . info ( '!!!!' )
1+ const Mocha = require ( 'mocha' ) ,
2+ fs = require ( 'fs' ) ,
3+ path = require ( 'path' ) ;
4+
5+ const { getSpecFilesArr} = require ( './rerun' )
6+
7+ // Instantiate a Mocha instance.
8+ var mocha = new Mocha ( ) ;
9+
10+ const itSpecNameRegex = / (?< = i t \( ' ) ( \d | \w | \s ) + / ig
11+
12+
13+
14+ var testDir = path . relative ( __dirname , './mocha_specs' )
15+
16+ // Add each .js file to the mocha instance
17+ getSpecFilesArr ( testDir )
18+
19+
20+ . forEach ( function ( file ) {
21+
22+ const fileContent = fs . readFileSync ( file , { encoding : 'utf8' } )
23+
24+ console . log ( fileContent . match ( itSpecNameRegex ) )
25+
26+ // mocha.addFile(
27+ // path.join(testDir, file)
28+ // );
29+ } ) ;
30+
31+
32+
33+
34+ // // Run the tests.
35+ // mocha.run(function(failures) {
36+ // process.exitCode = failures ? 1 : 0; // exit with non-zero status if there were failures
37+ // });
Original file line number Diff line number Diff line change 1+ const { expect} = require ( 'chai' )
2+
3+ describe ( 'First describe' , ( ) => {
4+ it ( 'it 1 first describe ' , ( ) => {
5+ expect ( 1 ) . to . eql ( 1 )
6+ } )
7+ it ( 'it 2 first describe ' , ( ) => {
8+ expect ( 1 ) . to . eql ( 2 )
9+ } )
10+ it ( 'it 3 first describe ' , ( ) => {
11+ expect ( 1 ) . to . eql ( 3 )
12+ } )
13+ } )
14+
Original file line number Diff line number Diff line change 1+ const { expect} = require ( 'chai' )
2+
3+ describe ( 'Second describe' , ( ) => {
4+ it ( 'it 1 second describe ' , ( ) => {
5+ expect ( 1 ) . to . eql ( 1 )
6+ } )
7+ it ( 'it 2 second describe ' , ( ) => {
8+ expect ( 1 ) . to . eql ( 2 )
9+ } )
10+ it ( 'it 3 second describe ' , ( ) => {
11+ expect ( 1 ) . to . eql ( 3 )
12+ } )
13+ } )
Original file line number Diff line number Diff line change 1+ const { expect} = require ( 'chai' )
2+
3+ describe ( 'Third describe' , ( ) => {
4+ it ( 'it 1 third describe ' , ( ) => {
5+ expect ( 1 ) . to . eql ( 1 )
6+ } )
7+ it ( 'it 2 third describe ' , ( ) => {
8+ expect ( 1 ) . to . eql ( 2 )
9+ } )
10+ it ( 'it 3 third describe ' , ( ) => {
11+ expect ( 1 ) . to . eql ( 3 )
12+ } )
13+ } )
Original file line number Diff line number Diff line change 11{
22 "name" : " process-rerun" ,
3- "version" : " 0.0.14 " ,
3+ "version" : " 0.0.15 " ,
44 "bin" : {
55 "protractor-rerun" : " ./bin/rerun"
66 },
You can’t perform that action at this time.
0 commit comments