Skip to content

Commit

Permalink
test: fix s3 ispec putObject (#5319)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe authored Oct 4, 2023
1 parent 9afa5ef commit bdf5d16
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions clients/client-s3/test/e2e/S3.ispec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,23 @@ describe("@aws-sdk/client-s3", () => {

it("should succeed with valid body payload", async () => {
// prepare the object.
const body = createBuffer("1MB");
await client.putObject({ Bucket, Key, Body: body });
const result = await client.getObject({ Bucket, Key });
const body = createBuffer("16KB");

try {
await client.putObject({ Bucket, Key, Body: body });
} catch (e) {
console.error("failed to put");
throw e;
}

try {
// eslint-disable-next-line no-var
var result = await client.getObject({ Bucket, Key });
} catch (e) {
console.error("failed to get");
throw e;
}

expect(result.$metadata.httpStatusCode).to.equal(200);
if (isBrowser) {
expect(result.Body).to.be.instanceOf(ReadableStream);
Expand Down Expand Up @@ -284,7 +298,6 @@ esfuture,29`;
});
const events: SelectObjectContentEventStream[] = [];
for await (const event of Payload!) {
console.log(event);
events.push(event);
}
expect(events.length).to.equal(3);
Expand Down

0 comments on commit bdf5d16

Please sign in to comment.