Skip to content

Update binary url to cloudflare R2 #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 5 additions & 5 deletions lib/LocalBinary.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ function LocalBinary(){

this.getDownloadPath = function () {
if(this.hostOS.match(/darwin|mac os/i)){
return 'https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-darwin-x64';
return 'https://www.browserstack.com/local-testing/downloads/bin/BrowserStackLocal-darwin-x64';
} else if(this.hostOS.match(/mswin|msys|mingw|cygwin|bccwin|wince|emc|win32/i)) {
this.windows = true;
return 'https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal.exe';
return 'https://www.browserstack.com/local-testing/downloads/bin/BrowserStackLocal.exe';
} else {
if(this.is64bits) {
if(this.isAlpine())
return 'https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-alpine';
return 'https://www.browserstack.com/local-testing/downloads/bin/BrowserStackLocal-alpine';
else
return 'https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-linux-x64';
return 'https://www.browserstack.com/local-testing/downloads/bin/BrowserStackLocal-linux-x64';
} else {
return 'https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-linux-ia32';
return 'https://www.browserstack.com/local-testing/downloads/bin/BrowserStackLocal-linux-ia32';
}
}
};
Expand Down
10 changes: 5 additions & 5 deletions test/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,37 +365,37 @@ describe('LocalBinary', function () {
var osNames = ['darwin', 'mac os'];
osNames.forEach(function(os) {
sandBox.stub(localBinary, 'hostOS', os);
expect(localBinary.getDownloadPath()).to.equal('https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-darwin-x64');
expect(localBinary.getDownloadPath()).to.equal('https://www.browserstack.com/local-testing/downloads/bin/BrowserStackLocal-darwin-x64');
});
});

it('should return download path of exe binary', function() {
var osNames = ['mswin', 'msys', 'mingw', 'cygwin', 'bccwin', 'wince', 'emc', 'win32'];
osNames.forEach(function(os) {
sandBox.stub(localBinary, 'hostOS', os);
expect(localBinary.getDownloadPath()).to.equal('https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal.exe');
expect(localBinary.getDownloadPath()).to.equal('https://www.browserstack.com/local-testing/downloads/bin/BrowserStackLocal.exe');
});
});

it('should return download path of linux 64 arch binary', function() {
sandBox.stub(localBinary, 'hostOS', 'linux');
sandBox.stub(localBinary, 'is64bits', true);
localBinary.isAlpine = sandBox.stub(localBinary, 'isAlpine').returns(false);
expect(localBinary.getDownloadPath()).to.equal('https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-linux-x64');
expect(localBinary.getDownloadPath()).to.equal('https://www.browserstack.com/local-testing/downloads/bin/BrowserStackLocal-linux-x64');
});

it('should return download path of linux 32 arch binary', function() {
sandBox.stub(localBinary, 'hostOS', 'linux');
sandBox.stub(localBinary, 'is64bits', false);
localBinary.isAlpine = sandBox.stub(localBinary, 'isAlpine').returns(false);
expect(localBinary.getDownloadPath()).to.equal('https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-linux-ia32');
expect(localBinary.getDownloadPath()).to.equal('https://www.browserstack.com/local-testing/downloads/bin/BrowserStackLocal-linux-ia32');
});

it('should return download path of alpine linux binary', function() {
sandBox.stub(localBinary, 'hostOS', 'linux');
localBinary.isAlpine = sandBox.stub(localBinary, 'isAlpine').returns(true);
sandBox.stub(localBinary, 'is64bits', true);
expect(localBinary.getDownloadPath()).to.equal('https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-alpine');
expect(localBinary.getDownloadPath()).to.equal('https://www.browserstack.com/local-testing/downloads/bin/BrowserStackLocal-alpine');
});

afterEach(function(done) {
Expand Down