Skip to content

Commit f0eeddb

Browse files
tniessenMylesBorins
authored andcommitted
test: reuse existing PassThrough implementation
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>
1 parent 4752fc4 commit f0eeddb

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

test/parallel/test-stream-big-packet.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ const stream = require('stream');
55

66
let passed = false;
77

8-
class PassThrough extends stream.Transform {
9-
_transform(chunk, encoding, done) {
10-
this.push(chunk);
11-
done();
12-
}
13-
}
14-
158
class TestStream extends stream.Transform {
169
_transform(chunk, encoding, done) {
1710
if (!passed) {
@@ -22,8 +15,8 @@ class TestStream extends stream.Transform {
2215
}
2316
}
2417

25-
const s1 = new PassThrough();
26-
const s2 = new PassThrough();
18+
const s1 = new stream.PassThrough();
19+
const s2 = new stream.PassThrough();
2720
const s3 = new TestStream();
2821
s1.pipe(s3);
2922
// Don't let s2 auto close which may close s3

0 commit comments

Comments
 (0)