test: test pipeline end on transform streams

Add test that confirms that
`stream.promises.pipeline(source, transform, dest, {end: false});`
only skips ending the destination stream.
`{end: false}` should still end any transform streams.

PR-URL: https://github.com/nodejs/node/pull/48970
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Alois Klink authored and Michaël Zasso committed 2024-05-12 21:21:58 +02:00
1 parent 04de5766ee
commit 5469adf458
1 file changed
+5 -1
+5 -1
View File
@@ -1476,10 +1476,14 @@ const tsp = require('timers/promises');
});
const duplex = new PassThrough();
const transform = new PassThrough();
read.push(null);
await pipelinePromise(read, duplex, { end: false });
await pipelinePromise(read, transform, duplex, { end: false });
assert.strictEqual(transform.destroyed, true);
assert.strictEqual(transform.writableEnded, true);
assert.strictEqual(duplex.destroyed, false);
assert.strictEqual(duplex.writableEnded, false);