Skip to content

Commit 38b3c2a

Browse files
rickyesMylesBorins
authored andcommitted
test: add arrayOfStreams to pipeline
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>
1 parent 0f9bafd commit 38b3c2a

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
@@ -1211,3 +1211,23 @@ const net = require('net');
12111211
d.write('test');
12121212
d.end();
12131213
}
1214+
1215+
{
1216+
const r = new Readable({
1217+
read() {}
1218+
});
1219+
r.push('hello');
1220+
r.push('world');
1221+
r.push(null);
1222+
let res = '';
1223+
const w = new Writable({
1224+
write(chunk, encoding, callback) {
1225+
res += chunk;
1226+
callback();
1227+
}
1228+
});
1229+
pipeline([r, w], common.mustCall((err) => {
1230+
assert.ok(!err);
1231+
assert.strictEqual(res, 'helloworld');
1232+
}));
1233+
}

0 commit comments

Comments
 (0)