File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -239,12 +239,15 @@ export const validateAndSanitizeConfig = (config) => {
239239}
240240
241241export 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 ( / ^ h t t p s ? : \/ \/ / , '' )
250253}
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments