diff --git a/lib/Local.js b/lib/Local.js index ce00a15..1f00ac4 100644 --- a/lib/Local.js +++ b/lib/Local.js @@ -134,7 +134,7 @@ function Local(){ case 'localIdentifier': if(value) - this.localIdentifierFlag = '-localIdentifier ' + value; + this.localIdentifierFlag = value; break; case 'f': @@ -146,22 +146,22 @@ function Local(){ case 'proxyHost': if(value) - this.proxyHost = '-proxyHost ' + value; + this.proxyHost = value; break; case 'proxyPort': if(value) - this.proxyPort = '-proxyPort ' + value; + this.proxyPort = value; break; case 'proxyUser': if(value) - this.proxyUser = '-proxyUser ' + value; + this.proxyUser = value; break; case 'proxyPass': if(value) - this.proxyPass = '-proxyPass ' + value; + this.proxyPass = value; break; case 'forceproxy': @@ -214,20 +214,30 @@ function Local(){ args.push(this.folderPath); if(this.forceLocalFlag) args.push(this.forceLocalFlag); - if(this.localIdentifierFlag) + if(this.localIdentifierFlag){ + args.push('-localIdentifier'); args.push(this.localIdentifierFlag); + } if(this.onlyFlag) args.push(this.onlyFlag); if(this.onlyAutomateFlag) args.push(this.onlyAutomateFlag); - if(this.proxyHost) + if(this.proxyHost){ + args.push('-proxyHost'); args.push(this.proxyHost); - if(this.proxyPort) + } + if(this.proxyPort){ + args.push('-proxyPort'); args.push(this.proxyPort); - if(this.proxyUser) + } + if(this.proxyUser){ + args.push('-proxyUser'); args.push(this.proxyUser); - if(this.proxyPass) + } + if(this.proxyPass){ + args.push('-proxyPass'); args.push(this.proxyPass); + } if(this.forceProxyFlag) args.push(this.forceProxyFlag); if(this.forceFlag) diff --git a/package.json b/package.json index 60c3094..6603623 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "browserstack-local", - "version": "0.2.0", + "version": "1.0.0", "description": "Nodejs bindings for BrowserStack Local", "engine": "^0.10.44", "main": "index.js", diff --git a/test/local.js b/test/local.js index 1413e3f..f73a260 100644 --- a/test/local.js +++ b/test/local.js @@ -112,7 +112,8 @@ describe('Local', function () { it('should set localIdentifier', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'localIdentifier': 'abcdef' }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-localIdentifier abcdef')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('-localIdentifier')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('abcdef')).to.not.equal(-1); done(); }); }); @@ -126,10 +127,14 @@ describe('Local', function () { 'proxyUser': 'user', 'proxyPass': 'pass' }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-proxyHost localhost')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf('-proxyPort 8080')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf('-proxyUser user')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf('-proxyPass pass')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('-proxyHost')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('localhost')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('-proxyPort')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf(8080)).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('-proxyUser')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('user')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('-proxyPass')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('pass')).to.not.equal(-1); done(); }); });