Skip to content

Commit 2f67e99

Browse files
rickyesaddaleax
authored andcommittedSep 28, 2020
test: add arrayOfStreams to pipeline
PR-URL: nodejs/node#34156 Backport-PR-URL: nodejs/node#35388 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 05da376 commit 2f67e99

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
 

‎test/parallel/test-stream-pipeline.js

+20
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,23 @@ const { promisify } = require('util');
518518
}).on('error', common.mustNotCall());
519519
});
520520
}
521+
522+
{
523+
const r = new Readable({
524+
read() {}
525+
});
526+
r.push('hello');
527+
r.push('world');
528+
r.push(null);
529+
let res = '';
530+
const w = new Writable({
531+
write(chunk, encoding, callback) {
532+
res += chunk;
533+
callback();
534+
}
535+
});
536+
pipeline([r, w], common.mustCall((err) => {
537+
assert.ok(!err);
538+
assert.strictEqual(res, 'helloworld');
539+
}));
540+
}

0 commit comments

Comments
 (0)
Failed to load comments.