Skip to content

Commit dc30cee

Browse files
only pass string values to args
1 parent f1fc10d commit dc30cee

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

lib/Local.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function Local(){
125125
if(value.toString() !== 'true')
126126
this.verboseFlag = value;
127127
else {
128-
this.verboseFlag = 1;
128+
this.verboseFlag = '1';
129129
}
130130
break;
131131

@@ -245,7 +245,7 @@ function Local(){
245245
}
246246
if(this.parallelRunsFlag){
247247
args.push('--parallel-runs');
248-
args.push(this.parallelRunsFlag);
248+
args.push(this.parallelRunsFlag.toString());
249249
}
250250
if(this.onlyHosts) {
251251
args.push('--only');
@@ -275,7 +275,7 @@ function Local(){
275275
args.push(this.forceFlag);
276276
if(this.verboseFlag){
277277
args.push('--verbose');
278-
args.push(this.verboseFlag);
278+
args.push(this.verboseFlag.toString());
279279
}
280280
for(var i in this.userArgs){
281281
args.push(this.userArgs[i]);

test/local.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,23 @@ describe('Local', function () {
5252
it('should enable verbose', function (done) {
5353
bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'verbose': true }, function(){
5454
expect(bsLocal.getBinaryArgs().indexOf('--verbose')).to.not.equal(-1);
55-
expect(bsLocal.getBinaryArgs().indexOf(1)).to.not.equal(-1);
55+
expect(bsLocal.getBinaryArgs().indexOf('1')).to.not.equal(-1);
5656
done();
5757
});
5858
});
5959

6060
it('should enable verbose with log level', function (done) {
6161
bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'verbose': 2 }, function(){
6262
expect(bsLocal.getBinaryArgs().indexOf('--verbose')).to.not.equal(-1);
63-
expect(bsLocal.getBinaryArgs().indexOf(2)).to.not.equal(-1);
63+
expect(bsLocal.getBinaryArgs().indexOf('2')).to.not.equal(-1);
64+
done();
65+
});
66+
});
67+
68+
it('should enable verbose with log level string', function (done) {
69+
bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'verbose': '2' }, function(){
70+
expect(bsLocal.getBinaryArgs().indexOf('--verbose')).to.not.equal(-1);
71+
expect(bsLocal.getBinaryArgs().indexOf('2')).to.not.equal(-1);
6472
done();
6573
});
6674
});
@@ -157,6 +165,22 @@ describe('Local', function () {
157165
});
158166
});
159167

168+
it('should set parallelRuns', function (done) {
169+
bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'parallelRuns': '10' }, function(){
170+
expect(bsLocal.getBinaryArgs().indexOf('-parallel-runs')).to.not.equal(-1);
171+
expect(bsLocal.getBinaryArgs().indexOf('10')).to.not.equal(-1);
172+
done();
173+
});
174+
});
175+
176+
it('should set parallelRuns with integer value', function (done) {
177+
bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'parallelRuns': 10 }, function(){
178+
expect(bsLocal.getBinaryArgs().indexOf('-parallel-runs')).to.not.equal(-1);
179+
expect(bsLocal.getBinaryArgs().indexOf('10')).to.not.equal(-1);
180+
done();
181+
});
182+
});
183+
160184
it('should set proxy', function (done) {
161185
bsLocal.start({
162186
'key': process.env.BROWSERSTACK_ACCESS_KEY,

0 commit comments

Comments
 (0)