test: reuse existing PassThrough implementation

PR-URL: https://github.com/nodejs/node/pull/16936
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Tobias Nießen 2017-11-10 18:27:35 +01:00
parent 803cacd228
commit 6b351e92dc
No known key found for this signature in database
GPG Key ID: 718207F8FD156B70

View File

@ -26,13 +26,6 @@ const stream = require('stream');
let passed = false;
class PassThrough extends stream.Transform {
_transform(chunk, encoding, done) {
this.push(chunk);
done();
}
}
class TestStream extends stream.Transform {
_transform(chunk, encoding, done) {
if (!passed) {
@ -43,8 +36,8 @@ class TestStream extends stream.Transform {
}
}
const s1 = new PassThrough();
const s2 = new PassThrough();
const s1 = new stream.PassThrough();
const s2 = new stream.PassThrough();
const s3 = new TestStream();
s1.pipe(s3);
// Don't let s2 auto close which may close s3