Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup
  • Loading branch information
rickyes committed Jul 8, 2020
commit 69df9a0eb6ac655e06e492774dcd2f0458ae2882
21 changes: 21 additions & 0 deletions test/parallel/test-stream-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,27 @@ const net = require('net');
}));
}

// Set destroyDestOnError is true to streams
{
const r = new Readable({
read() {}
});
r.push('hello');
r.push('world');
r.push(null);
let res = '';
const w = new Writable({
write(chunk, encoding, callback) {
res += chunk;
callback();
}
});
pipeline([r, w], { destroyDestOnError: true }, common.mustCall((err) => {
assert.ok(!err);
assert.strictEqual(res, 'helloworld');
}));
}

// Set destroyDestOnError is false
{
const server = http.createServer(common.mustCall((req, res) => {
Expand Down