const cypress = require ( 'cypress' ) ; const server = require ( './server' ) ; return server . start ( ) . then ( listeningServer => { return cypress . run ( { browser : process . env . BROWSER || 'chrome' , config : { baseUrl : 'http://localhost:8080' , video : false , } , } ) . then ( results => { listeningServer . close ( ) ; if ( results . totalFailed > 0 ) { process . exit ( 1 ) ; } } ) . catch ( ( ) => { process . exit ( 1 ) ; } ) ; } ) ;