Navigation Menu

Skip to content

Commit

Permalink
test: add arrayOfStreams to pipeline
Browse files Browse the repository at this point in the history
PR-URL: #34156
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
rickyes authored and MylesBorins committed Jul 16, 2020
1 parent 0f9bafd commit 38b3c2a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/parallel/test-stream-pipeline.js
Expand Up @@ -1211,3 +1211,23 @@ const net = require('net');
d.write('test');
d.end();
}

{
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');
}));
}

0 comments on commit 38b3c2a

Please sign in to comment.