mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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:
1 parent
04de5766ee
commit
5469adf458
1 file changed
+5
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user