Skip to content

Commit

Permalink
fix downloading custom sauce connect version
Browse files Browse the repository at this point in the history
  • Loading branch information
budziam committed Jan 29, 2025
1 parent 015c8a8 commit eb38a2b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apis/sauce.json
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@
"clientVersion": {
"description": "SC client version",
"in": "query",
"name": "client_version",
"name": "version",
"required": false,
"type": "string"
},
Expand Down
8 changes: 2 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ export default class SauceLabs {
const isDownloaded = await scLoader.verifyAlreadyDownloaded();

if (!isDownloaded) {
console.info(`Downloading Sauce Connect v${sauceConnectVersion}...`);
let download = await this._getSauceConnectDownload(sauceConnectVersion);

// downloaded version may differ from the input version, eg. if a partial version is given as input
// update scLoader if necessary
if (download.version != sauceConnectVersion) {
Expand Down Expand Up @@ -619,11 +619,7 @@ export default class SauceLabs {
}

if (typeof optionValue !== 'undefined') {
// version is a reserved keyword, so convert to the parameter name here
const optionName =
optionParam.name == 'client_version' ? 'version' : optionParam.name;

bodyMap.set(optionName, optionValue);
bodyMap.set(optionParam.name, optionValue);
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ test('should contain expected macos download link', async () => {
})
);
const scDownload = await api.scDownload({
client_version: '5.2.2',
version: '5.2.2',
os: 'macos',
arch: 'x86_64',
});
Expand Down Expand Up @@ -461,7 +461,7 @@ test('should contain expected windows download link', async () => {
})
);
const scDownload = await api.scDownload({
client_version: '5.2.2',
version: '5.2.2',
os: 'windows',
arch: 'x86_64',
});
Expand Down

0 comments on commit eb38a2b

Please sign in to comment.