File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
packages/s3-request-presigner/src Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -196,9 +196,10 @@ describe("getSignedUrl", () => {
196196 } ) ;
197197 } ) ;
198198
199- it ( "should throw if presign request with MRAP ARN and disableMultiregionAccessPoints option" , ( ) => {
199+ it ( "should throw if presign request with MRAP ARN and disableMultiregionAccessPoints option" , async ( ) => {
200200 const mockPresigned = "a presigned url" ;
201201 vi . mocked ( mockS3RequestPresigner . presign ) . mockReturnValue ( mockPresigned as any ) ;
202+
202203 const client = new S3Client ( {
203204 ...clientParams ,
204205 disableMultiregionAccessPoints : true ,
@@ -207,13 +208,9 @@ describe("getSignedUrl", () => {
207208 Bucket : "arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap" ,
208209 Key : "Key" ,
209210 } ) ;
210- return expect ( getSignedUrl ( client , command ) ) . rejects . toEqual (
211- new ( class EndpointError extends Error {
212- constructor ( ...args : any [ ] ) {
213- super ( ...args ) ;
214- this . name = "EndpointError" ;
215- }
216- } ) ( "Invalid configuration: Multi-Region Access Point ARNs are disabled." )
217- ) ;
211+
212+ const error = await getSignedUrl ( client , command ) . catch ( ( e ) => e ) ;
213+ expect ( error . name ) . toEqual ( "EndpointError" ) ;
214+ expect ( error . message ) . toEqual ( "Invalid configuration: Multi-Region Access Point ARNs are disabled." ) ;
218215 } ) ;
219216} ) ;
You can’t perform that action at this time.
0 commit comments