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: #48970
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
aloisklink authored and marco-ippolito committed Jun 17, 2024
1 parent 7a812dd commit 304bbd5
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 304bbd5

Please sign in to comment.