From 2f67e99a0b63ebcbb231a6a049c72c64c45c894b Mon Sep 17 00:00:00 2001 From: rickyes Date: Wed, 1 Jul 2020 21:43:59 +0800 Subject: [PATCH] test: add arrayOfStreams to pipeline PR-URL: https://github.com/nodejs/node/pull/34156 Backport-PR-URL: https://github.com/nodejs/node/pull/35388 Reviewed-By: Robert Nagy Reviewed-By: Matteo Collina Reviewed-By: Anna Henningsen --- test/parallel/test-stream-pipeline.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/parallel/test-stream-pipeline.js b/test/parallel/test-stream-pipeline.js index 27fff7756f5e16..be96891a18b0cc 100644 --- a/test/parallel/test-stream-pipeline.js +++ b/test/parallel/test-stream-pipeline.js @@ -518,3 +518,23 @@ const { promisify } = require('util'); }).on('error', common.mustNotCall()); }); } + +{ + const r = new Readable({ + read() {} + }); + r.push('hello'); + r.push('world'); + r.push(null); + let res = ''; + const w = new Writable({ + write(chunk, encoding, callback) { + res += chunk; + callback(); + } + }); + pipeline([r, w], common.mustCall((err) => { + assert.ok(!err); + assert.strictEqual(res, 'helloworld'); + })); +}