diff --git a/test-parity/known_failures.json b/test-parity/known_failures.json index 92489c7d3cb..88eb72a2cc6 100644 --- a/test-parity/known_failures.json +++ b/test-parity/known_failures.json @@ -1705,5 +1705,23 @@ "added": "2026-05-23", "category": "bug-open", "reason": "node:stream/web: pipeTo preventCancel option behavior not implemented. Flips to PASS when #1545 lands." + }, + "node-suite/stream/duplex-pair/wired-comms": { + "issue": "1532", + "added": "2026-05-23", + "category": "bug-open", + "reason": "node:stream: duplexPair() — fails to compile (export not yet wired through perry-stdlib stream re-exports). Flips to PASS when #1532 lands." + }, + "node-suite/stream/finished/error-false-option": { + "issue": "1532", + "added": "2026-05-23", + "category": "bug-open", + "reason": "node:stream: finished({error:false}) option ignored — callback still fires on destroy(err). Flips to PASS when #1532 lands." + }, + "node-suite/stream/compose/single-sync-fn": { + "issue": "1531", + "added": "2026-05-23", + "category": "bug-open", + "reason": "node:stream: compose(readable, asyncGenFn) — fails to compile (single-fn compose form not yet wired). Flips to PASS when #1531 lands." } } diff --git a/test-parity/node-suite/stream/compose/single-sync-fn.ts b/test-parity/node-suite/stream/compose/single-sync-fn.ts new file mode 100644 index 00000000000..920b1d08c72 --- /dev/null +++ b/test-parity/node-suite/stream/compose/single-sync-fn.ts @@ -0,0 +1,10 @@ +import { compose, Readable } from "node:stream"; +// compose() accepts a single async-generator function and turns it into +// a stream pipeline. Source is a Readable; sink is the generator output. +async function* upper(src: AsyncIterable) { + for await (const c of src) yield String(c).toUpperCase(); +} +const out: string[] = []; +const composed: any = compose(Readable.from(["a", "b", "c"]), upper as any); +composed.on("data", (c: any) => out.push(String(c))); +composed.on("end", () => console.log("composed:", out.join(","))); diff --git a/test-parity/node-suite/stream/duplex-pair/wired-comms.ts b/test-parity/node-suite/stream/duplex-pair/wired-comms.ts new file mode 100644 index 00000000000..16b26f3b9f1 --- /dev/null +++ b/test-parity/node-suite/stream/duplex-pair/wired-comms.ts @@ -0,0 +1,10 @@ +import { duplexPair } from "node:stream"; +// duplexPair() returns two paired Duplex streams: data written to one +// appears as readable data on the other (bidirectional in-memory pipe). +const [a, b] = (duplexPair as any)(); +const chunks: string[] = []; +b.on("data", (c: any) => chunks.push(String(c))); +b.on("end", () => console.log("b got:", chunks.join("|"))); +a.write("hello "); +a.write("world"); +a.end(); diff --git a/test-parity/node-suite/stream/finished/error-false-option.ts b/test-parity/node-suite/stream/finished/error-false-option.ts new file mode 100644 index 00000000000..d2c09eab478 --- /dev/null +++ b/test-parity/node-suite/stream/finished/error-false-option.ts @@ -0,0 +1,13 @@ +import { Readable, finished } from "node:stream"; +// finished(stream, { error: false }, cb) — should NOT fire the callback +// when the stream emits an error (only on normal completion). +const r = new Readable({ read() {} }); +r.on("error", () => {}); +let fired = false; +let firedWith: any = null; +finished(r, { error: false } as any, (err: any) => { + fired = true; + firedWith = err; +}); +r.destroy(new Error("kaboom")); +setImmediate(() => console.log("fired:", fired, "with:", firedWith)); diff --git a/test-parity/node-suite/stream/readable/from-rejected-promise.ts b/test-parity/node-suite/stream/readable/from-rejected-promise.ts new file mode 100644 index 00000000000..d2e466a082b --- /dev/null +++ b/test-parity/node-suite/stream/readable/from-rejected-promise.ts @@ -0,0 +1,8 @@ +import { Readable } from "node:stream"; +// Readable.from(promise) — when the promise rejects, the stream should +// emit an `error` event with the rejection reason. +const p = Promise.reject(new Error("boom")); +const r = Readable.from(p); +r.on("error", (e: any) => console.log("err:", (e && e.message) || String(e))); +r.on("data", () => {}); +r.on("end", () => console.log("end"));