Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe(resolveAssumeRoleCredentials.name, () => {
`Detected a cycle attempting to resolve credentials for profile` +
` ${mockProfileName}. Profiles visited: ` +
Object.keys({ mockProfileName: true }).join(", "),
false
{ tryNextLink: true }
);

try {
Expand Down
3 changes: 2 additions & 1 deletion packages/credential-provider-sso/src/fromSSO.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ describe(fromSSO.name, () => {
it.each(["ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"])("missing '%s'", async (key) => {
const expectedError = new CredentialsProviderError(
'Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl",' +
' "ssoAccountId", "ssoRegion", "ssoRoleName"'
' "ssoAccountId", "ssoRegion", "ssoRoleName"',
{ tryNextLink: false }
);
try {
await fromSSO({ ...mockSsoProfile, [key]: undefined })();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe(updateDiscoveredEndpointInCache.name, () => {
`The operation to discover endpoint failed.` +
` Please retry, or provide a custom endpoint and disable endpoint discovery to proceed.`
),
{ reason: error }
{ reason: new Error("rejected") }
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe(regionRedirectMiddleware.name, () => {
await handler({ input: null });
}).rejects.toThrowError(
Object.assign(new Error(), {
Code: "PermanentRedirect",
name: "PermanentRedirect",
$metadata: { httpStatusCode: 301 },
$response: { headers: { "x-amz-bucket-region": redirectRegion } },
})
Expand Down
15 changes: 6 additions & 9 deletions packages/s3-request-presigner/src/getSignedUrl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ describe("getSignedUrl", () => {
});
});

it("should throw if presign request with MRAP ARN and disableMultiregionAccessPoints option", () => {
it("should throw if presign request with MRAP ARN and disableMultiregionAccessPoints option", async () => {
const mockPresigned = "a presigned url";
vi.mocked(mockS3RequestPresigner.presign).mockReturnValue(mockPresigned as any);

const client = new S3Client({
...clientParams,
disableMultiregionAccessPoints: true,
Expand All @@ -207,13 +208,9 @@ describe("getSignedUrl", () => {
Bucket: "arn:aws:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap",
Key: "Key",
});
return expect(getSignedUrl(client, command)).rejects.toEqual(
new (class EndpointError extends Error {
constructor(...args: any[]) {
super(...args);
this.name = "EndpointError";
}
})("Invalid configuration: Multi-Region Access Point ARNs are disabled.")
);

const error = await getSignedUrl(client, command).catch((e) => e);
expect(error.name).toEqual("EndpointError");
expect(error.message).toEqual("Invalid configuration: Multi-Region Access Point ARNs are disabled.");
});
});
Loading