1
1
// 1. start the dev server using production config
2
- process . env . NODE_ENV = ' testing'
3
- var server = require ( ' ../../build/dev-server.js' )
2
+ process . env . NODE_ENV = " testing" ;
3
+ const server = require ( " ../../build/dev-server.js" ) ;
4
4
5
5
server . ready . then ( ( ) => {
6
6
// 2. run the nightwatch test suite against it
@@ -10,26 +10,26 @@ server.ready.then(() => {
10
10
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
11
11
// For more information on Nightwatch's config file, see
12
12
// http://nightwatchjs.org/guide#settings-file
13
- var opts = process . argv . slice ( 2 )
14
- if ( opts . indexOf ( ' --config' ) === - 1 ) {
15
- opts = opts . concat ( [ ' --config' , ' test/e2e/nightwatch.conf.js' ] )
13
+ let opts = process . argv . slice ( 2 ) ;
14
+ if ( opts . indexOf ( " --config" ) === - 1 ) {
15
+ opts = opts . concat ( [ " --config" , " test/e2e/nightwatch.conf.js" ] ) ;
16
16
}
17
- if ( opts . indexOf ( ' --env' ) === - 1 ) {
18
- opts = opts . concat ( [ ' --env' , ' chrome,phantomjs' ] )
17
+ if ( opts . indexOf ( " --env" ) === - 1 ) {
18
+ opts = opts . concat ( [ " --env" , " chrome,phantomjs" ] ) ;
19
19
}
20
20
21
- var spawn = require ( ' cross-spawn' )
22
- var runner = spawn ( ' ./node_modules/.bin/nightwatch' , opts , {
23
- stdio : ' inherit'
24
- } )
21
+ let spawn = require ( " cross-spawn" ) ;
22
+ let runner = spawn ( " ./node_modules/.bin/nightwatch" , opts , {
23
+ stdio : " inherit"
24
+ } ) ;
25
25
26
- runner . on ( ' exit' , function ( code ) {
27
- server . close ( )
28
- process . exit ( code )
29
- } )
26
+ runner . on ( " exit" , function ( code ) {
27
+ server . close ( ) ;
28
+ process . exit ( code ) ;
29
+ } ) ;
30
30
31
- runner . on ( ' error' , function ( err ) {
32
- server . close ( )
33
- throw err
34
- } )
35
- } )
31
+ runner . on ( " error" , function ( err ) {
32
+ server . close ( ) ;
33
+ throw err ;
34
+ } ) ;
35
+ } ) ;
0 commit comments