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.
  • Loading branch information
aloisklink committed Jul 30, 2023
1 parent a955c53 commit cb79504
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 cb79504

Please sign in to comment.