Skip to content

Commit 72fd383

Browse files
committed
fix downloading custom sauce connect version
1 parent cf30751 commit 72fd383

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

apis/sauce.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@
789789
"clientVersion": {
790790
"description": "SC client version",
791791
"in": "query",
792-
"name": "client_version",
792+
"name": "version",
793793
"required": false,
794794
"type": "string"
795795
},

src/index.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ export default class SauceLabs {
323323
const isDownloaded = await scLoader.verifyAlreadyDownloaded();
324324

325325
if (!isDownloaded) {
326+
console.info(`Downloading Sauce Connect v${sauceConnectVersion}...`);
326327
let download = await this._getSauceConnectDownload(sauceConnectVersion);
327-
328328
// downloaded version may differ from the input version, eg. if a partial version is given as input
329329
// update scLoader if necessary
330330
if (download.version != sauceConnectVersion) {
@@ -619,11 +619,7 @@ export default class SauceLabs {
619619
}
620620

621621
if (typeof optionValue !== 'undefined') {
622-
// version is a reserved keyword, so convert to the parameter name here
623-
const optionName =
624-
optionParam.name == 'client_version' ? 'version' : optionParam.name;
625-
626-
bodyMap.set(optionName, optionValue);
622+
bodyMap.set(optionParam.name, optionValue);
627623
}
628624
}
629625

tests/index.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ test('should contain expected macos download link', async () => {
433433
})
434434
);
435435
const scDownload = await api.scDownload({
436-
client_version: '5.2.2',
436+
version: '5.2.2',
437437
os: 'macos',
438438
arch: 'x86_64',
439439
});
@@ -461,7 +461,7 @@ test('should contain expected windows download link', async () => {
461461
})
462462
);
463463
const scDownload = await api.scDownload({
464-
client_version: '5.2.2',
464+
version: '5.2.2',
465465
os: 'windows',
466466
arch: 'x86_64',
467467
});

0 commit comments

Comments
 (0)