11'use strict' ;
22
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' ) ;
77
88function collectPaths ( value , paths ) {
9- paths . push ( value ) ;
10- return paths ;
9+ paths . push ( value ) ;
10+ return paths ;
1111}
1212
1313program
@@ -48,7 +48,7 @@ global.junitPath = path.resolve(program.junit || program.reports);
4848global . DEFAULT_TIMEOUT = global . DEFAULT_TIMEOUT || program . timeOut || 10 * 1000 ;
4949
5050// 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 ) {
5252 return path . resolve ( item ) ;
5353} ) ;
5454
@@ -57,7 +57,7 @@ process.argv.splice(2, 100);
5757
5858// allow a specific feature file to be executed
5959if ( program . featureFile ) {
60- process . argv . push ( program . featureFile ) ;
60+ process . argv . push ( program . featureFile ) ;
6161}
6262
6363// add switch to tell cucumber to produce json report files
@@ -91,16 +91,18 @@ var cucumberCli = cucumber.Cli(process.argv);
9191global . cucumber = cucumber ;
9292
9393cucumberCli . 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+ }
106108} ) ;
0 commit comments