summaryrefslogtreecommitdiff
path: root/tests/unit_node/stream_test.ts
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-09-09 18:36:56 +0530
committerGitHub <noreply@github.com>2024-09-09 15:06:56 +0200
commit5126ccb8428c4ccf199d3b30f1cd86ef11009ef7 (patch)
treecc1ad32867d90d86828e9da0fa2057edfa8df5b5 /tests/unit_node/stream_test.ts
parentea8bf0945ac93a16a3d8df2470c70d9cf1c36172 (diff)
fix(ext/node): Stream should be instance of EventEmitter (#25527)
Closes https://github.com/denoland/deno/issues/25526
Diffstat (limited to 'tests/unit_node/stream_test.ts')
-rw-r--r--tests/unit_node/stream_test.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/unit_node/stream_test.ts b/tests/unit_node/stream_test.ts
index 8d4970146..0aa2de18c 100644
--- a/tests/unit_node/stream_test.ts
+++ b/tests/unit_node/stream_test.ts
@@ -4,8 +4,9 @@ import { assert, assertEquals } from "@std/assert";
import { fromFileUrl, relative } from "@std/path";
import { pipeline } from "node:stream/promises";
// @ts-expect-error: @types/node is outdated
-import { getDefaultHighWaterMark } from "node:stream";
+import { getDefaultHighWaterMark, Stream } from "node:stream";
import { createReadStream, createWriteStream } from "node:fs";
+import { EventEmitter } from "node:events";
Deno.test("stream/promises pipeline", async () => {
const filePath = relative(
@@ -30,3 +31,8 @@ Deno.test("stream getDefaultHighWaterMark", () => {
assertEquals(getDefaultHighWaterMark(false), 16 * 1024);
assertEquals(getDefaultHighWaterMark(true), 16);
});
+
+Deno.test("stream is an instance of EventEmitter", () => {
+ const stream = new Stream();
+ assert(stream instanceof EventEmitter);
+});