Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ exports.setDefaults = (bsConfig, args) => {
if (bsConfig.run_settings && this.isUndefined(bsConfig.run_settings.npm_dependencies)) {
bsConfig.run_settings.npm_dependencies = {}
}

// setting connection_settings to {} if not present
if (this.isUndefined(bsConfig.connection_settings)) {
bsConfig.connection_settings = {};
}

}

exports.setUsername = (bsConfig, args) => {
Expand Down
17 changes: 17 additions & 0 deletions test/unit/bin/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,23 @@ describe('utils', () => {
expect(utils.isUndefined(bsConfig.auth)).to.be.true;
expect(utils.isUndefined(bsConfig.run_settings.npm_dependencies)).to.be.false;
});

it ('should set connection_settings if bsConfig.connection_settings is undefined' , () => {
let bsConfig = { run_settings: {} };
utils.setDefaults(bsConfig, {});
expect(utils.isUndefined(bsConfig.connection_settings)).to.be.false;
});

it('should not set connection_settings if bsConfig.connection_settings is defined ', () => {
let bsConfig = {
run_settings: {},
connection_settings: {
local: "false"
}
};
utils.setDefaults(bsConfig, {});
expect(bsConfig.connection_settings).to.deep.equal({local: "false"});
});
});

describe('getNumberOfSpecFiles', () => {
Expand Down