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 <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • 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.