aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/bun.js')
-rw-r--r--test/bun.js/streams.test.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/bun.js/streams.test.js b/test/bun.js/streams.test.js
index 577570221..ec803a9dd 100644
--- a/test/bun.js/streams.test.js
+++ b/test/bun.js/streams.test.js
@@ -48,6 +48,24 @@ describe("WritableStream", () => {
throw e;
}
});
+
+ it("pipeTo", async () => {
+ const rs = new ReadableStream({
+ start(controller) {
+ controller.enqueue("hello world");
+ controller.close();
+ },
+ });
+
+ let received;
+ const ws = new WritableStream({
+ write(chunk, controller) {
+ received = chunk;
+ },
+ });
+ await rs.pipeTo(ws);
+ expect(received).toBe("hello world");
+ });
});
describe("ReadableStream.prototype.tee", () => {