Skip to content

Commit 1ed742f

Browse files
respect region param - fixes webdriverio/webdriverio#7637
1 parent 053adfc commit 1ed742f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,9 @@ export default class SauceLabs {
248248
args.push(`--user=${this.username}`)
249249
args.push(`--api-key=${this._accessKey}`)
250250

251-
if (!args.some(arg => arg.startsWith('--region'))) {
252-
const scRegion = getRegionSubDomain(this.region)
251+
const region = argv.region || this.region
252+
if (region) {
253+
const scRegion = getRegionSubDomain({ region })
253254
.split('-').slice(0, 2).join('-')
254255
args.push(`--region=${scRegion}`)
255256
}

tests/__snapshots__/index.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Array [
3333
"--no-proxy-caching",
3434
"--user=foo",
3535
"--api-key=bar",
36-
"--region=us-west",
36+
"--region=eu-central",
3737
],
3838
],
3939
]

tests/index.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ describe('startSauceConnect', () => {
385385
tunnelIdentifier: 'my-tunnel',
386386
'proxy-tunnel': 'abc',
387387
verbose: true,
388+
region: 'eu',
388389
noProxyCaching: true,
389390
logger: (log) => logs.push(log)
390391
})

0 commit comments

Comments
 (0)