summaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-pipeline.js
diff options
context:
space:
mode:
authorZiJian Liu <Lxxyxzj@gmail.com>2020-12-11 22:11:14 +0800
committerNode.js GitHub Bot <github-bot@iojs.org>2020-12-15 13:40:40 +0000
commit6837a6de9760fcff8ad106009538b0c5cebd1967 (patch)
tree40676d3457b933a89f9ae9b818e7fa5645544636 /test/parallel/test-stream-pipeline.js
parent45dbcbef90d9002efbe3c67202d0338eb243b2a1 (diff)
downloadnode-new-6837a6de9760fcff8ad106009538b0c5cebd1967.tar.gz
stream: accept iterable as a valid first argument
Fixes: https://github.com/nodejs/node/issues/36437 PR-URL: https://github.com/nodejs/node/pull/36479 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'test/parallel/test-stream-pipeline.js')
-rw-r--r--test/parallel/test-stream-pipeline.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/parallel/test-stream-pipeline.js b/test/parallel/test-stream-pipeline.js
index f4801ece26..78057f9eef 100644
--- a/test/parallel/test-stream-pipeline.js
+++ b/test/parallel/test-stream-pipeline.js
@@ -1285,3 +1285,19 @@ const net = require('net');
});
const pipelined = addAbortSignal(ac.signal, pipeline([r, w], cb));
}
+
+{
+ pipeline([1, 2, 3], PassThrough({ objectMode: true }),
+ common.mustSucceed(() => {}));
+
+ let res = '';
+ const w = new Writable({
+ write(chunk, encoding, callback) {
+ res += chunk;
+ callback();
+ },
+ });
+ pipeline(['1', '2', '3'], w, common.mustSucceed(() => {
+ assert.strictEqual(res, '123');
+ }));
+}