File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,12 @@ exports.setDefaults = (bsConfig, args) => {
158158 if ( bsConfig . run_settings && this . isUndefined ( bsConfig . run_settings . npm_dependencies ) ) {
159159 bsConfig . run_settings . npm_dependencies = { }
160160 }
161+
162+ // setting connection_settings to {} if not present
163+ if ( this . isUndefined ( bsConfig . connection_settings ) ) {
164+ bsConfig . connection_settings = { } ;
165+ }
166+
161167}
162168
163169exports . setUsername = ( bsConfig , args ) => {
Original file line number Diff line number Diff line change @@ -1428,6 +1428,23 @@ describe('utils', () => {
14281428 expect ( utils . isUndefined ( bsConfig . auth ) ) . to . be . true ;
14291429 expect ( utils . isUndefined ( bsConfig . run_settings . npm_dependencies ) ) . to . be . false ;
14301430 } ) ;
1431+
1432+ it ( 'should set connection_settings if bsConfig.connection_settings is undefined' , ( ) => {
1433+ let bsConfig = { run_settings : { } } ;
1434+ utils . setDefaults ( bsConfig , { } ) ;
1435+ expect ( utils . isUndefined ( bsConfig . connection_settings ) ) . to . be . false ;
1436+ } ) ;
1437+
1438+ it ( 'should not set connection_settings if bsConfig.connection_settings is defined ' , ( ) => {
1439+ let bsConfig = {
1440+ run_settings : { } ,
1441+ connection_settings : {
1442+ local : "false"
1443+ }
1444+ } ;
1445+ utils . setDefaults ( bsConfig , { } ) ;
1446+ expect ( bsConfig . connection_settings ) . to . deep . equal ( { local : "false" } ) ;
1447+ } ) ;
14311448 } ) ;
14321449
14331450 describe ( 'getNumberOfSpecFiles' , ( ) => {
You can’t perform that action at this time.
0 commit comments