Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Dec 18, 2020
1 parent 0af4317 commit 0996479
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/parallel/test-stream-pipe-needDrain.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ const assert = require('assert');
const Readable = require('_stream_readable');
const Writable = require('_stream_writable');

// Pipe should not continue writing if writable needs drain.
// Pipe should pause temporarily if writable needs drain.
{
const w = new Writable({
write(buf, encoding, callback) {

}
process.nextTick(callback);
},
highWaterMark: 1
});

while (w.write('asd'));
Expand All @@ -20,10 +21,12 @@ const Writable = require('_stream_writable');
const r = new Readable({
read() {
this.push('asd');
this.push(null);
}
});

w.write = common.mustNotCall();
r.on('pause', common.mustCall());
r.on('end', common.mustCall());

r.pipe(w);
}

0 comments on commit 0996479

Please sign in to comment.