@@ -15,8 +15,8 @@ interface Arguments {
1515}
1616
1717interface ISocketData {
18- id : number
19- payload : string
18+ id : number ;
19+ payload : string ;
2020}
2121
2222export default class RunProject {
@@ -29,7 +29,7 @@ export default class RunProject {
2929 private projectId : number | undefined = undefined ;
3030
3131 constructor ( argv : Arguments ) {
32- if ( typeof ( argv . cf ) === 'string' ) {
32+ if ( typeof argv . cf === 'string' ) {
3333 this . configFilePath = argv . cf ;
3434 }
3535 }
@@ -38,13 +38,16 @@ export default class RunProject {
3838 this . stopJob ( ) ;
3939 if ( this . config && this . config . run_settings . start_tunnel ) {
4040 if ( this . tunnel ) {
41- this . tunnel . stop ( ) . then ( ( ) => {
42- process . exit ( ) ;
43- } ) . catch ( log . error ) ;
41+ this . tunnel
42+ . stop ( )
43+ . then ( ( ) => {
44+ process . exit ( ) ;
45+ } )
46+ . catch ( log . error ) ;
4447 this . tunnel = undefined ;
4548 }
4649 } else {
47- process . exit ( )
50+ process . exit ( ) ;
4851 }
4952 }
5053
@@ -63,9 +66,9 @@ export default class RunProject {
6366 uri : `https://api.testingbot.com/v1/cypress/${ this . projectId } /stop_project` ,
6467 auth : {
6568 user : this . config ? this . config . auth . key : '' ,
66- pass : this . config ? this . config . auth . secret : '' ,
69+ pass : this . config ? this . config . auth . secret : '' ,
6770 sendImmediately : true ,
68- }
71+ } ,
6972 } ;
7073
7174 request ( requestOptions , ( error ) => {
@@ -79,17 +82,21 @@ export default class RunProject {
7982 }
8083
8184 public errorHandler ( err : Error ) : void {
82- log . error ( chalk . white . bgRed . bold ( `A fatal error occurred, please report this to testingbot.com` ) ) ;
85+ log . error (
86+ chalk . white . bgRed . bold (
87+ `A fatal error occurred, please report this to testingbot.com` ,
88+ ) ,
89+ ) ;
8390 log . error ( err ) ;
8491 this . exitHandler ( ) ;
8592 }
8693
8794 private registerCloseHandlers ( ) : void {
8895 //do something when app is closing
89- process . on ( 'exit' , this . exitHandler . bind ( this , { cleanup :true } ) ) ;
90- process . on ( 'SIGINT' , this . exitHandler . bind ( this , { exit :true } ) ) ;
91- process . on ( 'SIGUSR1' , this . exitHandler . bind ( this , { exit :true } ) ) ;
92- process . on ( 'SIGUSR2' , this . exitHandler . bind ( this , { exit :true } ) ) ;
96+ process . on ( 'exit' , this . exitHandler . bind ( this , { cleanup : true } ) ) ;
97+ process . on ( 'SIGINT' , this . exitHandler . bind ( this , { exit : true } ) ) ;
98+ process . on ( 'SIGUSR1' , this . exitHandler . bind ( this , { exit : true } ) ) ;
99+ process . on ( 'SIGUSR2' , this . exitHandler . bind ( this , { exit : true } ) ) ;
93100 process . on ( 'uncaughtException' , this . errorHandler . bind ( this ) ) ;
94101 }
95102
@@ -113,11 +120,11 @@ export default class RunProject {
113120 }
114121
115122 private parseTestCases ( runs : IRun [ ] ) : ITest [ ] {
116- const testCases : ITest [ ] = [ ]
123+ const testCases : ITest [ ] = [ ] ;
117124 for ( let i = 0 ; i < runs . length ; i ++ ) {
118125 const testCase = runs [ i ] . test ;
119126 if ( testCase ) {
120- testCases . push ( testCase )
127+ testCases . push ( testCase ) ;
121128 }
122129 }
123130
@@ -129,14 +136,24 @@ export default class RunProject {
129136 try {
130137 config = await Config . getConfig ( this . configFilePath || `testingbot.json` ) ;
131138 } catch ( e ) {
132- log . error ( chalk . white . bgRed . bold ( `Configuration file problem: ${ e . message } for Config File: ${ this . configFilePath || `testingbot.json` } ` ) ) ;
139+ log . error (
140+ chalk . white . bgRed . bold (
141+ `Configuration file problem: ${ e . message } for Config File: ${
142+ this . configFilePath || `testingbot.json`
143+ } `,
144+ ) ,
145+ ) ;
133146 return ;
134147 }
135-
148+
136149 const configValidationErrors = Config . validate ( config ) ;
137150
138151 if ( configValidationErrors . length > 0 ) {
139- log . error ( chalk . white . bgRed . bold ( `Configuration errors: ${ configValidationErrors . join ( '\n' ) } ` ) ) ;
152+ log . error (
153+ chalk . white . bgRed . bold (
154+ `Configuration errors: ${ configValidationErrors . join ( '\n' ) } ` ,
155+ ) ,
156+ ) ;
140157 return ;
141158 }
142159
@@ -177,7 +194,7 @@ export default class RunProject {
177194
178195 if ( config . run_settings . realTimeLogs ) {
179196 const realTime = io . connect ( 'https://hub.testingbot.com:3031' ) ;
180- realTime . emit ( 'join' , `cypress_${ response . id } ` )
197+ realTime . emit ( 'join' , `cypress_${ response . id } ` ) ;
181198 realTime . on ( 'cypress_data' , this . realTimeMessage . bind ( this ) ) ;
182199 realTime . on ( 'cypress_error' , this . realTimeError . bind ( this ) ) ;
183200 }
@@ -194,7 +211,6 @@ export default class RunProject {
194211 }
195212
196213 process . exit ( success === true ? 0 : 1 ) ;
197-
198214 } catch ( err ) {
199215 log . error ( chalk . white . bgRed . bold ( err ) ) ;
200216 if ( config . run_settings . start_tunnel ) {
0 commit comments