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

fix: error on apac #169

Merged
merged 1 commit into from
Jun 20, 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
2 changes: 1 addition & 1 deletion lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const ENDPOINT_STAGE_INTERNAL = 'https://storage-state-<region>.stg.app-builder.

const ALLOWED_REGIONS = [ // first region is the default region
'amer',
'apac',
'emea'
// soon to come: 'apac'
]

// can be overwritten by env
Expand Down
6 changes: 3 additions & 3 deletions test/AdobeState.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ describe('private methods', () => {
})

test('no params, region set', async () => {
const region = 'apac'
const region = 'emea'
const env = PROD_ENV
mockCLIEnv.mockReturnValue(env)

Expand All @@ -564,7 +564,7 @@ describe('private methods', () => {
mockCLIEnv.mockReturnValue(env)

await expect(AdobeState.init({ ...fakeCredentials, region })).rejects
.toThrow('[AdobeStateLib:ERROR_BAD_ARGUMENT] /region must be equal to one of the allowed values: amer, apac, emea')
.toThrow('[AdobeStateLib:ERROR_BAD_ARGUMENT] /region must be equal to one of the allowed values: amer, emea')
})
})

Expand Down Expand Up @@ -608,7 +608,7 @@ describe('private methods', () => {
jest.resetModules()
process.env.AIO_STATE_ENDPOINT = 'https://custom.abc.com'
const env = STAGE_ENV
const region = 'apac'
const region = 'amer'
mockCLIEnv.mockReturnValue(env)

// need to instantiate a new store, when env changes
Expand Down