@@ -8,6 +8,8 @@ describe("configureEnvironment", () => {
88 expect ( env ) . toEqual ( {
99 AWS_ACCESS_KEY_ID : "test" ,
1010 AWS_SECRET_ACCESS_KEY : "test" ,
11+ AWS_REGION : "us-east-1" ,
12+ AWS_DEFAULT_REGION : "us-east-1" ,
1113 AWS_ENDPOINT_URL : "http://localhost.localstack.cloud:4566" ,
1214 AWS_ENDPOINT_URL_S3 : "http://s3.localhost.localstack.cloud:4566" ,
1315 } ) ;
@@ -23,6 +25,8 @@ describe("configureEnvironment", () => {
2325 expect ( env ) . toEqual ( {
2426 AWS_ACCESS_KEY_ID : "test" ,
2527 AWS_SECRET_ACCESS_KEY : "test" ,
28+ AWS_REGION : "us-east-1" ,
29+ AWS_DEFAULT_REGION : "us-east-1" ,
2630 AWS_ENDPOINT_URL : "http://foo.bar:4567" ,
2731 AWS_ENDPOINT_URL_S3 : "http://foo.bar:4567" ,
2832 } ) ;
@@ -45,6 +49,8 @@ describe("configureEnvironment", () => {
4549 expect ( env ) . toEqual ( {
4650 AWS_ACCESS_KEY_ID : "test" ,
4751 AWS_SECRET_ACCESS_KEY : "test" ,
52+ AWS_REGION : "us-east-1" ,
53+ AWS_DEFAULT_REGION : "us-east-1" ,
4854 AWS_ENDPOINT_URL : "http://localhost.localstack.cloud:4566" ,
4955 AWS_ENDPOINT_URL_S3 : "http://s3.localhost.localstack.cloud:4566" ,
5056 } ) ;
@@ -60,6 +66,8 @@ describe("configureEnvironment", () => {
6066 AWS_ACCESS_KEY_ID : "test" ,
6167 AWS_SECRET_ACCESS_KEY : "test" ,
6268 AWS_PROFILE : "my-profile" ,
69+ AWS_REGION : "us-east-1" ,
70+ AWS_DEFAULT_REGION : "us-east-1" ,
6371 AWS_ENDPOINT_URL : "http://localhost.localstack.cloud:4566" ,
6472 AWS_ENDPOINT_URL_S3 : "http://s3.localhost.localstack.cloud:4566" ,
6573 } ) ;
@@ -75,6 +83,25 @@ describe("configureEnvironment", () => {
7583 expect ( env ) . toEqual ( {
7684 AWS_ACCESS_KEY_ID : "something" ,
7785 AWS_SECRET_ACCESS_KEY : "else" ,
86+ AWS_REGION : "us-east-1" ,
87+ AWS_DEFAULT_REGION : "us-east-1" ,
88+ AWS_ENDPOINT_URL : "http://localhost.localstack.cloud:4566" ,
89+ AWS_ENDPOINT_URL_S3 : "http://s3.localhost.localstack.cloud:4566" ,
90+ } ) ;
91+ } ) ;
92+
93+ test ( "region overriding" , ( ) => {
94+ const env = {
95+ AWS_REGION : "eu-central-1" ,
96+ AWS_DEFAULT_REGION : "eu-central-1" ,
97+ } ;
98+ const allowListStr = "AWS_REGION,AWS_DEFAULT_REGION" ;
99+ configureEnvironment ( env , allowListStr ) ;
100+ expect ( env ) . toEqual ( {
101+ AWS_ACCESS_KEY_ID : "test" ,
102+ AWS_SECRET_ACCESS_KEY : "test" ,
103+ AWS_REGION : "eu-central-1" ,
104+ AWS_DEFAULT_REGION : "eu-central-1" ,
78105 AWS_ENDPOINT_URL : "http://localhost.localstack.cloud:4566" ,
79106 AWS_ENDPOINT_URL_S3 : "http://s3.localhost.localstack.cloud:4566" ,
80107 } ) ;
0 commit comments