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(){
104
104
} ;
105
105
106
106
this . stop = function ( callback ) {
107
+ if ( typeof callback === 'undefined' )
108
+ callback = function ( ) { } ;
107
109
if ( ! this . pid ) return callback ( ) ;
108
110
this . opcode = 'stop' ;
109
111
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 () {
182
182
} ) ;
183
183
184
184
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 ,
188
188
'proxyHost' : 'localhost' ,
189
189
'proxyPort' : 8080 ,
190
190
'proxyUser' : 'user' ,
@@ -208,7 +208,14 @@ describe('Local', function () {
208
208
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'localhost,8000,0' ) ) . to . not . equal ( - 1 ) ;
209
209
done ( ) ;
210
210
} ) ;
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
+ } )
212
219
213
220
afterEach ( function ( done ) {
214
221
this . timeout ( 60000 ) ;
You can’t perform that action at this time.
0 commit comments