Skip to content

Commit 0996479

Browse files
committed
fixup
1 parent 0af4317 commit 0996479

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/parallel/test-stream-pipe-needDrain.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ const assert = require('assert');
55
const Readable = require('_stream_readable');
66
const Writable = require('_stream_writable');
77

8-
// Pipe should not continue writing if writable needs drain.
8+
// Pipe should pause temporarily if writable needs drain.
99
{
1010
const w = new Writable({
1111
write(buf, encoding, callback) {
12-
13-
}
12+
process.nextTick(callback);
13+
},
14+
highWaterMark: 1
1415
});
1516

1617
while (w.write('asd'));
@@ -20,10 +21,12 @@ const Writable = require('_stream_writable');
2021
const r = new Readable({
2122
read() {
2223
this.push('asd');
24+
this.push(null);
2325
}
2426
});
2527

26-
w.write = common.mustNotCall();
28+
r.on('pause', common.mustCall());
29+
r.on('end', common.mustCall());
2730

2831
r.pipe(w);
2932
}

0 commit comments

Comments
 (0)