@@ -6,6 +6,8 @@ describe("configureEnvironment", () => {
66 const allowListStr = "" ;
77 configureEnvironment ( env , allowListStr ) ;
88 expect ( env ) . toEqual ( {
9+ AWS_ACCESS_KEY_ID : "test" ,
10+ AWS_SECRET_ACCESS_KEY : "test" ,
911 AWS_ENDPOINT_URL : "http://localhost.localstack.cloud:4566" ,
1012 AWS_ENDPOINT_URL_S3 : "http://s3.localhost.localstack.cloud:4566" ,
1113 } ) ;
@@ -19,6 +21,8 @@ describe("configureEnvironment", () => {
1921 const allowListStr = "" ;
2022 configureEnvironment ( env , allowListStr ) ;
2123 expect ( env ) . toEqual ( {
24+ AWS_ACCESS_KEY_ID : "test" ,
25+ AWS_SECRET_ACCESS_KEY : "test" ,
2226 AWS_ENDPOINT_URL : "http://foo.bar:4567" ,
2327 AWS_ENDPOINT_URL_S3 : "http://foo.bar:4567" ,
2428 } ) ;
@@ -39,6 +43,8 @@ describe("configureEnvironment", () => {
3943 const allowListStr = "" ;
4044 configureEnvironment ( env , allowListStr ) ;
4145 expect ( env ) . toEqual ( {
46+ AWS_ACCESS_KEY_ID : "test" ,
47+ AWS_SECRET_ACCESS_KEY : "test" ,
4248 AWS_ENDPOINT_URL : "http://localhost.localstack.cloud:4566" ,
4349 AWS_ENDPOINT_URL_S3 : "http://s3.localhost.localstack.cloud:4566" ,
4450 } ) ;
@@ -51,9 +57,26 @@ describe("configureEnvironment", () => {
5157 const allowListStr = "AWS_PROFILE" ;
5258 configureEnvironment ( env , allowListStr ) ;
5359 expect ( env ) . toEqual ( {
60+ AWS_ACCESS_KEY_ID : "test" ,
61+ AWS_SECRET_ACCESS_KEY : "test" ,
5462 AWS_PROFILE : "my-profile" ,
5563 AWS_ENDPOINT_URL : "http://localhost.localstack.cloud:4566" ,
5664 AWS_ENDPOINT_URL_S3 : "http://s3.localhost.localstack.cloud:4566" ,
5765 } ) ;
5866 } ) ;
67+
68+ test ( "credentials overriding" , ( ) => {
69+ const env = {
70+ AWS_ACCESS_KEY_ID : "something" ,
71+ AWS_SECRET_ACCESS_KEY : "else" ,
72+ } ;
73+ const allowListStr = "AWS_PROFILE,AWS_SECRET_ACCESS_KEY,AWS_ACCESS_KEY_ID" ;
74+ configureEnvironment ( env , allowListStr ) ;
75+ expect ( env ) . toEqual ( {
76+ AWS_ACCESS_KEY_ID : "something" ,
77+ AWS_SECRET_ACCESS_KEY : "else" ,
78+ AWS_ENDPOINT_URL : "http://localhost.localstack.cloud:4566" ,
79+ AWS_ENDPOINT_URL_S3 : "http://s3.localhost.localstack.cloud:4566" ,
80+ } ) ;
81+ } ) ;
5982} ) ;
0 commit comments