@@ -62,50 +62,52 @@ module.exports = function (selectedRuns, options) {
62
62
fail ( 'No runs provided. Use --all option to run all configured runs' ) ;
63
63
}
64
64
65
- const done = ( ) => event . emit ( event . multiple . before , null ) ;
66
- runHook ( config . bootstrapAll , done , 'bootstrapAll' ) ;
67
-
68
- if ( options . config ) { // update paths to config path
69
- if ( config . tests ) {
70
- config . tests = path . resolve ( testRoot , config . tests ) ;
65
+ const done = ( ) => {
66
+ event . emit ( event . multiple . before , null ) ;
67
+ if ( options . config ) { // update paths to config path
68
+ if ( config . tests ) {
69
+ config . tests = path . resolve ( testRoot , config . tests ) ;
70
+ }
71
+ if ( config . gherkin && config . gherkin . features ) {
72
+ config . gherkin . features = path . resolve ( testRoot , config . gherkin . features ) ;
73
+ }
71
74
}
72
- if ( config . gherkin && config . gherkin . features ) {
73
- config . gherkin . features = path . resolve ( testRoot , config . gherkin . features ) ;
75
+
76
+ if ( options . features ) {
77
+ config . tests = '' ;
74
78
}
75
- }
76
79
77
- if ( options . features ) {
78
- config . tests = '' ;
79
- }
80
+ if ( options . tests && config . gherkin ) {
81
+ config . gherkin . features = '' ;
82
+ }
80
83
81
- if ( options . tests && config . gherkin ) {
82
- config . gherkin . features = '' ;
83
- }
84
+ const childProcessesPromise = new Promise ( ( resolve , reject ) => {
85
+ processesDone = resolve ;
86
+ } ) ;
84
87
85
- const childProcessesPromise = new Promise ( ( resolve , reject ) => {
86
- processesDone = resolve ;
87
- } ) ;
88
+ const runsToExecute = [ ] ;
89
+ collection . createRuns ( selectedRuns , config ) . forEach ( ( run ) => {
90
+ const runName = run . getOriginalName ( ) || run . getName ( ) ;
91
+ const runConfig = run . getConfig ( ) ;
92
+ runsToExecute . push ( executeRun ( runName , runConfig ) ) ;
93
+ } ) ;
88
94
89
- const runsToExecute = [ ] ;
90
- collection . createRuns ( selectedRuns , config ) . forEach ( ( run ) => {
91
- const runName = run . getOriginalName ( ) || run . getName ( ) ;
92
- const runConfig = run . getConfig ( ) ;
93
- runsToExecute . push ( executeRun ( runName , runConfig ) ) ;
94
- } ) ;
95
+ if ( ! runsToExecute . length ) {
96
+ fail ( 'Nothing scheduled for execution' ) ;
97
+ }
95
98
96
- if ( ! runsToExecute . length ) {
97
- fail ( 'Nothing scheduled for execution' ) ;
98
- }
99
+ // Execute all forks
100
+ totalSubprocessCount = runsToExecute . length ;
101
+ runsToExecute . forEach ( runToExecute => runToExecute . call ( this ) ) ;
99
102
100
- // Execute all forks
101
- totalSubprocessCount = runsToExecute . length ;
102
- runsToExecute . forEach ( runToExecute => runToExecute . call ( this ) ) ;
103
+ return childProcessesPromise . then ( ( ) => {
104
+ // fire hook
105
+ const done = ( ) => event . emit ( event . multiple . after , null ) ;
106
+ runHook ( config . teardownAll , done , 'teardownAll' ) ;
107
+ } ) ;
108
+ } ;
103
109
104
- return childProcessesPromise . then ( ( ) => {
105
- // fire hook
106
- const done = ( ) => event . emit ( event . multiple . after , null ) ;
107
- runHook ( config . teardownAll , done , 'teardownAll' ) ;
108
- } ) ;
110
+ runHook ( config . bootstrapAll , done , 'bootstrapAll' ) ;
109
111
} ;
110
112
111
113
function executeRun ( runName , runConfig ) {
0 commit comments