File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
lambdas/pdm-mock-api/src/__tests__ Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,20 @@ describe('Config', () => {
105105 expect ( service ) . toBeInstanceOf ( ParameterStoreService ) ;
106106 } ) ;
107107
108+ it ( 'should use default AWS region when AWS_REGION not set' , ( ) => {
109+ delete process . env . AWS_REGION ;
110+ const serviceWithDefaultRegion = new ParameterStoreService ( ) ;
111+ expect ( serviceWithDefaultRegion ) . toBeInstanceOf ( ParameterStoreService ) ;
112+ expect ( serviceWithDefaultRegion . ssmClient ) . toBeDefined ( ) ;
113+ } ) ;
114+
115+ it ( 'should use AWS_REGION when set' , ( ) => {
116+ process . env . AWS_REGION = 'us-east-1' ;
117+ const serviceWithCustomRegion = new ParameterStoreService ( ) ;
118+ expect ( serviceWithCustomRegion ) . toBeInstanceOf ( ParameterStoreService ) ;
119+ expect ( serviceWithCustomRegion . ssmClient ) . toBeDefined ( ) ;
120+ } ) ;
121+
108122 it ( 'should cache parameter values' , async ( ) => {
109123 const mockParameter = 'test-value' ;
110124 const mockSend = jest . fn ( ) . mockResolvedValue ( {
You can’t perform that action at this time.
0 commit comments