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 authored and Myles Borins committed 2017-11-17 11:26:41 -05:00
1 parent 375bec00a4
commit efdd7c8cae
1 file changed
+2 -9
+2 -9
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