Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Feb 29, 2024
1 parent 7e7f7fb commit d41e669
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ describe("middleware-sdk-s3", () => {
hostname: "mybucket.com",
port: 8888,
path: "/my-bucket-path/my-key",
headers: {
host: "mybucket.com:8888",
},
});

await client.putObject({
Expand Down
6 changes: 3 additions & 3 deletions packages/middleware-sdk-s3/src/validate-bucket-name.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("validateBucketNameMiddleware", () => {
});

it("throws error if Bucket parameter contains '/'", async () => {
const handler = validateBucketNameMiddleware()(mockNextHandler, {} as any);
const handler = validateBucketNameMiddleware({} as any)(mockNextHandler, {} as any);
const bucket = "bucket/part/of/key";
let error;
try {
Expand All @@ -29,7 +29,7 @@ describe("validateBucketNameMiddleware", () => {
});

it("doesn't throw error if Bucket parameter has no '/'", async () => {
const handler = validateBucketNameMiddleware()(mockNextHandler, {} as any);
const handler = validateBucketNameMiddleware({} as any)(mockNextHandler, {} as any);
const args = {
input: {
Bucket: "bucket",
Expand All @@ -42,7 +42,7 @@ describe("validateBucketNameMiddleware", () => {

it("should not validate bucket name if the bucket name is an ARN", async () => {
mockValidateArn.mockReturnValue(true);
const handler = validateBucketNameMiddleware()(mockNextHandler, {} as any);
const handler = validateBucketNameMiddleware({} as any)(mockNextHandler, {} as any);
const args = {
input: {
Bucket: "arn:aws:s3:us-east-1:123456789012:accesspoint/myendpoint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export const initializeWithMaximalConfiguration = () => {
disableS3ExpressSessionAuth: false,
useGlobalEndpoint: false,
signingEscapePath: false,
bucketEndpoint: false,
};

const s3 = new S3Client(config);
Expand Down

0 comments on commit d41e669

Please sign in to comment.