@@ -188,20 +188,24 @@ describe("bucketHostname", () => {
188
188
189
189
describe ( "from Access Point ARN" , ( ) => {
190
190
describe ( "populates access point endpoint from ARN" , ( ) => {
191
- const s3Hostname = "s3.us-west-2.amazonaws.com" ;
192
191
const customHostname = "example.com" ;
193
192
194
- describe ( `baseHostname: ${ s3Hostname } ` , ( ) => {
195
- const baseHostname = s3Hostname ;
193
+ describe . each ( [
194
+ [ "s3.us-west-2.amazonaws.com" , false ] ,
195
+ [ "s3.dualstack.us-west-2.amazonaws.com" , true ] ,
196
+ ] ) ( `baseHostname: %s, dualstackEndpoint: %s` , ( baseHostname , dualstackEndpoint ) => {
196
197
it ( "should use client region" , ( ) => {
197
198
const { bucketEndpoint, hostname } = bucketHostname ( {
198
199
bucketName : parseArn ( "arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint" ) ,
199
200
baseHostname,
200
201
isCustomEndpoint : false ,
201
202
clientRegion : region ,
203
+ dualstackEndpoint,
202
204
} ) ;
203
205
expect ( bucketEndpoint ) . toBe ( true ) ;
204
- expect ( hostname ) . toBe ( "myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com" ) ;
206
+ expect ( hostname ) . toBe (
207
+ `myendpoint-123456789012.s3-accesspoint${ dualstackEndpoint ? ".dualstack" : "" } .us-west-2.amazonaws.com`
208
+ ) ;
205
209
} ) ;
206
210
207
211
it ( "should use ARN region" , ( ) => {
@@ -211,9 +215,12 @@ describe("bucketHostname", () => {
211
215
isCustomEndpoint : false ,
212
216
clientRegion : region ,
213
217
useArnRegion : true ,
218
+ dualstackEndpoint,
214
219
} ) ;
215
220
expect ( bucketEndpoint ) . toBe ( true ) ;
216
- expect ( hostname ) . toBe ( "myendpoint-123456789012.s3-accesspoint.us-east-1.amazonaws.com" ) ;
221
+ expect ( hostname ) . toBe (
222
+ `myendpoint-123456789012.s3-accesspoint${ dualstackEndpoint ? ".dualstack" : "" } .us-east-1.amazonaws.com`
223
+ ) ;
217
224
} ) ;
218
225
} ) ;
219
226
0 commit comments