@@ -17,7 +17,15 @@ describe("endpoint", () => {
1717 expect ( request . path ) . to . equal ( "/path/bucket/key" ) ;
1818 return Promise . resolve ( { output : { } as any , response : { } as any } ) ;
1919 } ;
20- const client = new S3 ( { endpoint : "http://localhost:8080/path" , forcePathStyle : true } ) ;
20+ const client = new S3 ( {
21+ endpoint : "http://localhost:8080/path" ,
22+ forcePathStyle : true ,
23+ region : "us-west-2" ,
24+ credentials : {
25+ accessKeyId : "CLIENT_TEST" ,
26+ secretAccessKey : "CLIENT_TEST" ,
27+ } ,
28+ } ) ;
2129
2230 client . middlewareStack . add ( endpointValidator , {
2331 step : "serialize" ,
@@ -48,7 +56,13 @@ describe("Endpoints from ARN", () => {
4856
4957 describe ( "Accesspoint ARN" , async ( ) => {
5058 it ( "should succeed with access point ARN" , async ( ) => {
51- const client = new S3 ( { region : "us-west-2" } ) ;
59+ const client = new S3 ( {
60+ region : "us-west-2" ,
61+ credentials : {
62+ accessKeyId : "CLIENT_TEST" ,
63+ secretAccessKey : "CLIENT_TEST" ,
64+ } ,
65+ } ) ;
5266 client . middlewareStack . add ( endpointValidator , { step : "build" , priority : "low" } ) ;
5367 const result : any = await client . putObject ( {
5468 Bucket : "arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint" ,
@@ -151,6 +165,10 @@ describe("Throw 200 response", () => {
151165
152166 const client = new S3 ( {
153167 region : "us-west-2" ,
168+ credentials : {
169+ accessKeyId : "CLIENT_TEST" ,
170+ secretAccessKey : "CLIENT_TEST" ,
171+ } ,
154172 requestHandler : {
155173 handle : async ( ) => ( {
156174 response,
@@ -228,7 +246,13 @@ describe("regional endpoints", () => {
228246 } ;
229247
230248 it ( "should use regional endpoints if region is us-east-1" , async ( ) => {
231- const client = new S3 ( { region : "us-east-1" } ) ;
249+ const client = new S3 ( {
250+ region : "us-east-1" ,
251+ credentials : {
252+ accessKeyId : "CLIENT_TEST" ,
253+ secretAccessKey : "CLIENT_TEST" ,
254+ } ,
255+ } ) ;
232256 client . middlewareStack . add ( endpointValidator , { step : "finalizeRequest" , priority : "low" } ) ;
233257 const result : any = await client . putObject ( {
234258 Bucket : "bucket" ,
@@ -239,7 +263,13 @@ describe("regional endpoints", () => {
239263 } ) ;
240264
241265 it ( "should use global endpoints if region is aws-global" , async ( ) => {
242- const client = new S3 ( { region : "aws-global" } ) ;
266+ const client = new S3 ( {
267+ region : "aws-global" ,
268+ credentials : {
269+ accessKeyId : "CLIENT_TEST" ,
270+ secretAccessKey : "CLIENT_TEST" ,
271+ } ,
272+ } ) ;
243273 client . middlewareStack . add ( endpointValidator , { step : "finalizeRequest" , priority : "low" } ) ;
244274 const result : any = await client . putObject ( {
245275 Bucket : "bucket" ,
@@ -263,7 +293,14 @@ describe("signing", () => {
263293 } ,
264294 } ;
265295
266- const client = new S3 ( { requestHandler } ) ;
296+ const client = new S3 ( {
297+ region : "us-west-2" ,
298+ credentials : {
299+ accessKeyId : "CLIENT_TEST" ,
300+ secretAccessKey : "CLIENT_TEST" ,
301+ } ,
302+ requestHandler,
303+ } ) ;
267304 return await client . putObject ( {
268305 Bucket : "bucket" ,
269306 Key : "some file.txt" ,
0 commit comments