1
1
'use strict' ;
2
2
3
- var path = require ( 'path' ) ,
4
- program = require ( 'commander' ) ,
5
- pjson = require ( './package.json' ) ,
6
- cucumber = require ( 'cucumber' ) ;
3
+ var path = require ( 'path' ) ;
4
+ var program = require ( 'commander' ) ;
5
+ var pjson = require ( './package.json' ) ;
6
+ var cucumber = require ( 'cucumber' ) ;
7
7
8
8
function collectPaths ( value , paths ) {
9
- paths . push ( value ) ;
10
- return paths ;
9
+ paths . push ( value ) ;
10
+ return paths ;
11
11
}
12
12
13
13
program
@@ -48,7 +48,7 @@ global.junitPath = path.resolve(program.junit || program.reports);
48
48
global . DEFAULT_TIMEOUT = global . DEFAULT_TIMEOUT || program . timeOut || 10 * 1000 ;
49
49
50
50
// used within world.js to import shared objects into the shared namespace
51
- global . sharedObjectPaths = program . sharedObjects . map ( function ( item ) {
51
+ global . sharedObjectPaths = program . sharedObjects . map ( function ( item ) {
52
52
return path . resolve ( item ) ;
53
53
} ) ;
54
54
@@ -57,7 +57,7 @@ process.argv.splice(2, 100);
57
57
58
58
// allow a specific feature file to be executed
59
59
if ( program . featureFile ) {
60
- process . argv . push ( program . featureFile ) ;
60
+ process . argv . push ( program . featureFile ) ;
61
61
}
62
62
63
63
// add switch to tell cucumber to produce json report files
@@ -91,16 +91,18 @@ var cucumberCli = cucumber.Cli(process.argv);
91
91
global . cucumber = cucumber ;
92
92
93
93
cucumberCli . run ( function ( succeeded ) {
94
- var code = succeeded ? 0 : 1 ;
95
-
96
- function exitNow ( ) {
97
- process . exit ( code ) ;
98
- }
99
-
100
- if ( process . stdout . write ( '' ) ) {
101
- exitNow ( ) ;
102
- } else {
103
- // write() returned false, kernel buffer is not empty yet...
104
- process . stdout . on ( 'drain' , exitNow ) ;
105
- }
94
+
95
+ var code = succeeded ? 0 : 1 ;
96
+
97
+ function exitNow ( ) {
98
+ process . exit ( code ) ;
99
+ }
100
+
101
+ if ( process . stdout . write ( '' ) ) {
102
+ exitNow ( ) ;
103
+ }
104
+ else {
105
+ // write() returned false, kernel buffer is not empty yet...
106
+ process . stdout . on ( 'drain' , exitNow ) ;
107
+ }
106
108
} ) ;
0 commit comments