File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -362,6 +362,11 @@ exports.setLocalIdentifier = (bsConfig, args) => {
362
362
"Reading local identifier from the environment variable BROWSERSTACK_LOCAL_IDENTIFIER"
363
363
) ;
364
364
bsConfig [ 'connection_settings' ] [ 'local_mode' ] = 'always-on' ;
365
+ } else if (
366
+ bsConfig [ 'connection_settings' ] [ 'local' ] &&
367
+ ! this . isUndefined ( bsConfig [ "connection_settings" ] [ "local_identifier" ] )
368
+ ) {
369
+ bsConfig [ 'connection_settings' ] [ 'local_mode' ] = 'always-on' ;
365
370
} else if (
366
371
bsConfig [ 'connection_settings' ] [ 'local' ] &&
367
372
this . isUndefined ( bsConfig [ "connection_settings" ] [ "local_identifier" ] )
Original file line number Diff line number Diff line change @@ -1114,7 +1114,19 @@ describe('utils', () => {
1114
1114
utils . setLocalIdentifier ( bsConfig , args ) ;
1115
1115
expect ( bsConfig . connection_settings . local_identifier ) . to . be . eq ( "xyz" ) ;
1116
1116
expect ( bsConfig . connection_settings . local_mode ) . to . be . eq ( 'always-on' ) ;
1117
+ } ) ;
1117
1118
1119
+ it ( 'if localIdentifier is defined then local_mode is set to always-on' , ( ) => {
1120
+ let bsConfig = {
1121
+ connection_settings : {
1122
+ local : true ,
1123
+ local_identifier : 'abc' ,
1124
+ } ,
1125
+ } ;
1126
+ let args = { }
1127
+ utils . setLocalIdentifier ( bsConfig , args ) ;
1128
+ expect ( bsConfig . connection_settings . local_identifier ) . to . be . eq ( "abc" ) ;
1129
+ expect ( bsConfig [ 'connection_settings' ] [ 'local_mode' ] ) . to . be . eq ( 'always-on' ) ;
1118
1130
} ) ;
1119
1131
} ) ;
1120
1132
You can’t perform that action at this time.
0 commit comments