Skip to content

Commit 466d85f

Browse files
committed
test(client-s3): mock the response body
1 parent e9e3b87 commit 466d85f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

clients/client-s3/test/integ/s3-selectObjectContent.integ.spec.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { S3 } from "@aws-sdk/client-s3";
22
import { HttpResponse } from "@smithy/protocol-http";
3+
import { Readable } from "stream";
34
import { describe, expect, test as it } from "vitest";
45

56
import { requireRequestsFrom } from "../../../../private/aws-util-test/src";
@@ -33,7 +34,16 @@ describe("selectObjectContent", () => {
3334
.respondWith(
3435
new HttpResponse({
3536
statusCode: 200,
36-
body: " ",
37+
body: Readable.from([
38+
`<?xml version="1.0" encoding="UTF-8"?>`,
39+
`<Payload>`,
40+
`<Records><Payload>blob</Payload></Records>`,
41+
`<Stats><Details><BytesProcessed>100</BytesProcessed><BytesReturned>50</BytesReturned><BytesScanned>100</BytesScanned></Details></Stats>`,
42+
`<Progress><Details><BytesProcessed>100</BytesProcessed><BytesReturned>50</BytesReturned><BytesScanned>100</BytesScanned></Details></Progress>`,
43+
`<Cont></Cont>`,
44+
`<End></End>`,
45+
`</Payload>`,
46+
]),
3747
})
3848
);
3949

0 commit comments

Comments
 (0)