File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ function Local(){
104104 } ;
105105
106106 this . stop = function ( callback ) {
107+ if ( typeof callback === 'undefined' )
108+ callback = function ( ) { } ;
107109 if ( ! this . pid ) return callback ( ) ;
108110 this . opcode = 'stop' ;
109111 this . tunnel = childProcess . execFile ( this . binaryPath , this . getBinaryArgs ( ) , function ( error ) {
Original file line number Diff line number Diff line change @@ -182,9 +182,9 @@ describe('Local', function () {
182182 } ) ;
183183
184184 it ( 'should set proxy' , function ( done ) {
185- bsLocal . start ( {
186- 'key' : process . env . BROWSERSTACK_ACCESS_KEY ,
187- onlyCommand : true ,
185+ bsLocal . start ( {
186+ 'key' : process . env . BROWSERSTACK_ACCESS_KEY ,
187+ onlyCommand : true ,
188188 'proxyHost' : 'localhost' ,
189189 'proxyPort' : 8080 ,
190190 'proxyUser' : 'user' ,
@@ -208,7 +208,14 @@ describe('Local', function () {
208208 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'localhost,8000,0' ) ) . to . not . equal ( - 1 ) ;
209209 done ( ) ;
210210 } ) ;
211- } ) ;
211+ } )
212+
213+ it ( 'does not error if no callback in stop' , function ( done ) {
214+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY } , function ( ) {
215+ bsLocal . stop ( ) ;
216+ done ( ) ;
217+ } ) ;
218+ } )
212219
213220 afterEach ( function ( done ) {
214221 this . timeout ( 60000 ) ;
You can’t perform that action at this time.
0 commit comments