Skip to content

Commit 5469adf

Browse files
aloisklinktargos
authored andcommitted
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: #48970 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 04de576 commit 5469adf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/parallel/test-stream-pipeline.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1476,10 +1476,14 @@ const tsp = require('timers/promises');
14761476
});
14771477

14781478
const duplex = new PassThrough();
1479+
const transform = new PassThrough();
14791480

14801481
read.push(null);
14811482

1482-
await pipelinePromise(read, duplex, { end: false });
1483+
await pipelinePromise(read, transform, duplex, { end: false });
1484+
1485+
assert.strictEqual(transform.destroyed, true);
1486+
assert.strictEqual(transform.writableEnded, true);
14831487

14841488
assert.strictEqual(duplex.destroyed, false);
14851489
assert.strictEqual(duplex.writableEnded, false);

0 commit comments

Comments
 (0)