Skip to content

Commit 7f8a1fb

Browse files
committed
Testing in workflow
1 parent dd4f539 commit 7f8a1fb

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/core/Util.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,15 @@ export const validateAndSanitizeConfig = (config) => {
239239
}
240240

241241
export const getRegionEndpoint = (region, service = 'contentManagement') => {
242+
console.log('region', region)
242243
const regionData = regionHostMap.regions.find(r =>
243244
r.id === region ||
244245
r.alias.some(alias => alias === region)
245246
)
247+
console.log('regionData', regionData)
246248
if (!regionData) {
247249
throw new Error(`Invalid region '${region}' provided. Allowed regions are: ${regionHostMap.regions.map(r => r.id).join(', ')}`)
248250
}
251+
console.log('regionData.endpoints[service]', regionData.endpoints[service])
249252
return regionData.endpoints[service]?.replace(/^https?:\/\//, '')
250253
}

test/unit/Util-test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,21 +399,25 @@ describe('Get User Agent', () => {
399399
done()
400400
})
401401

402-
it.skip('should be case-sensitive for region names', done => {
402+
it('should be case-sensitive for region names', done => {
403403
try {
404+
console.log('NA')
404405
getRegionEndpoint('NA', 'contentManagement')
405406
done(new Error('Should have thrown an error for uppercase region'))
406407
} catch (error) {
408+
console.log(error)
407409
expect(error.message).to.contain('Invalid region', 'Should throw error for uppercase region')
408410
done()
409411
}
410412
})
411413

412-
it.skip('should be case-sensitive for aliases', done => {
414+
it('should be case-sensitive for aliases', done => {
413415
try {
416+
console.log('US')
414417
getRegionEndpoint('US', 'contentManagement')
415418
done(new Error('Should have thrown an error for uppercase alias'))
416419
} catch (error) {
420+
console.log(error)
417421
expect(error.message).to.contain('Invalid region', 'Should throw error for uppercase alias')
418422
done()
419423
}

0 commit comments

Comments
 (0)