Skip to content

Commit

Permalink
test: add arrayOfStreams to pipeline
Browse files Browse the repository at this point in the history
PR-URL: nodejs#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 committed Sep 28, 2020
1 parent fd881c7 commit dba0a8d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/parallel/test-stream-pipeline.js
Expand Up @@ -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');
}));
}

0 comments on commit dba0a8d

Please sign in to comment.