Skip to content

Commit

Permalink
test: test pipeline end on transform streams
Browse files Browse the repository at this point in the history
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: nodejs#48970
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
aloisklink authored and aduh95 committed May 12, 2024
1 parent 1223294 commit f3f1aec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/parallel/test-stream-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f3f1aec

Please sign in to comment.