Skip to content
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

resolves #244 #248

Merged
merged 1 commit into from
Aug 8, 2024
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Your Sauce Labs datacenter region. The following regions are available:

- `us-west-1` (short `us`)
- `eu-central-1` (short `eu`)
- `us-east-4` (real mobile devices only)

Type: `string`
Default: `us`
Expand Down
2 changes: 1 addition & 1 deletion apis/builds.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"region": {
"default": "us-west-1",
"description": "region of datacenter",
"enum": ["us-west-1", "us-east-1", "eu-central-1", "staging"]
"enum": ["us-west-1", "us-east-4", "eu-central-1", "staging"]
},
"tld": {
"default": "com",
Expand Down
2 changes: 1 addition & 1 deletion apis/sauce.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"region": {
"default": "us-west-1",
"description": "region of datacenter",
"enum": ["us-west-1", "us-east-1", "eu-central-1", "staging"]
"enum": ["us-west-1", "us-east-4", "eu-central-1", "staging"]
},
"tld": {
"default": "com",
Expand Down
2 changes: 1 addition & 1 deletion apis/teamManagement.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"region": {
"default": "us-west-1",
"description": "region of datacenter",
"enum": ["us-west-1", "us-east-1", "eu-central-1", "staging"]
"enum": ["us-west-1", "us-east-4", "eu-central-1", "staging"]
},
"tld": {
"default": "com",
Expand Down
2 changes: 1 addition & 1 deletion scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface SauceLabsOptions {
*
* - us-west-1 (short 'us')
* - eu-central-1 (short 'eu')
* - us-east-1
* - us-east-4
*/
region?: ${regions};
/**
Expand Down
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const ASSET_REGION_MAPPING = {
us: '',
eu: 'eu-central-1.',
'us-west-1': '',
'us-east-1': 'us-east-1.',
'us-east-4': 'us-east-4.',
'eu-central-1': 'eu-central-1.',
staging: 'staging.',
};
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function getAPIHost(servers, basePath, options) {
* helper to generate host for assets, like:
* https://assets.saucelabs.com/jobs/<jobId>/selenium-server.log
* https://assets.eu-central-1.saucelabs.com/jobs/<jobId>/log.json
* https://assets.us-east-1.saucelabs.com/jobs/<jobId>/log.json
* https://assets.us-east-4.saucelabs.com/jobs/<jobId>/log.json
* https://assets.staging.saucelabs.net/jobs/<jobId>/log.json
*/
export function getAssetHost(options) {
Expand Down
4 changes: 2 additions & 2 deletions tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ test('should expose a webdriverEndpoint', () => {
const api3 = new SauceLabs({
user: 'foo',
key: 'bar',
region: 'us-east-1',
region: 'us-east-4',
});
expect(api3.webdriverEndpoint).toBe(
'https://ondemand.us-east-1.saucelabs.com/'
'https://ondemand.us-east-4.saucelabs.com/'
);

const api4 = new SauceLabs({user: 'foo', key: 'bar', region: 'us-central-3'});
Expand Down
7 changes: 5 additions & 2 deletions tests/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ test('getAPIHost', () => {
getAPIHost(sauceAPI.servers, sauceAPI.basePath, {region: 'us-west-1'})
).toBe('https://api.us-west-1.saucelabs.com/rest');
expect(
getAPIHost(sauceAPI.servers, sauceAPI.basePath, {region: 'us-east-1'})
).toBe('https://api.us-east-1.saucelabs.com/rest');
getAPIHost(sauceAPI.servers, sauceAPI.basePath, {region: 'us-east-4'})
).toBe('https://api.us-east-4.saucelabs.com/rest');
expect(
getAPIHost(sauceAPI.servers, sauceAPI.basePath, {host: 'http://foobar.com'})
).toBe('http://foobar.com/rest');
Expand Down Expand Up @@ -79,6 +79,9 @@ test('getAssetHost', () => {
expect(getAssetHost({region: 'eu-central-1'})).toBe(
'https://assets.eu-central-1.saucelabs.com'
);
expect(getAssetHost({region: 'us-east-4'})).toBe(
'https://assets.us-east-4.saucelabs.com'
);
expect(getAssetHost({region: 'staging'})).toBe(
'https://assets.staging.saucelabs.net'
);
Expand Down
Loading