Skip to content

Commit

Permalink
test: reuse existing PassThrough implementation
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
tniessen authored and MylesBorins committed Nov 28, 2017
1 parent 4752fc4 commit f0eeddb
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions test/parallel/test-stream-big-packet.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,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) {
Expand All @@ -22,8 +15,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
Expand Down

0 comments on commit f0eeddb

Please sign in to comment.