Skip to content

Commit 8260d05

Browse files
committed
add unit test cases
1 parent 04a376e commit 8260d05

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/unit/bin/helpers/utils.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,22 +928,25 @@ describe('utils', () => {
928928
});
929929

930930
it('should set setDefaults if args.username is present', () => {
931-
let bsConfig = {};
931+
let bsConfig = { run_settings: {} };
932932
utils.setDefaults(bsConfig, {username: 'username'});
933933
expect(utils.isUndefined(bsConfig.auth)).to.be.false;
934+
expect(utils.isUndefined(bsConfig.run_settings.npm_dependencies)).to.be.false;
934935
});
935936

936937
it('should set setDefaults if process.env.BROWSERSTACK_USERNAME is present and args.username is not present', () => {
937-
let bsConfig = {};
938+
let bsConfig = { run_settings: {} };
938939
process.env.BROWSERSTACK_USERNAME = 'username';
939940
utils.setDefaults(bsConfig, {});
940941
expect(utils.isUndefined(bsConfig.auth)).to.be.false;
942+
expect(utils.isUndefined(bsConfig.run_settings.npm_dependencies)).to.be.false;
941943
});
942944

943945
it('should not set setDefaults if process.env.BROWSERSTACK_USERNAME and args.username is not present', () => {
944-
let bsConfig = {};
946+
let bsConfig = { run_settings: {} };
945947
utils.setDefaults(bsConfig, {});
946948
expect(utils.isUndefined(bsConfig.auth)).to.be.true;
949+
expect(utils.isUndefined(bsConfig.run_settings.npm_dependencies)).to.be.false;
947950
});
948951
});
949952
});

0 commit comments

Comments
 (0)