Skip to content
Merged
Changes from all commits
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
test: increase coverage for stream writable
  • Loading branch information
Trott committed Jan 12, 2022
commit 904438965bbdc6bfb44a052b91a1fed177e56950
23 changes: 23 additions & 0 deletions test/parallel/test-stream-writable-final-throw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

const common = require('../common');
const {
Duplex,
} = require('stream');

{
class Foo extends Duplex {
_final(callback) {
throw new Error('fhqwhgads');
}

_read() {}
}

const foo = new Foo();
foo._write = common.mustCall((chunk, encoding, cb) => {
cb();
});
foo.end('test', common.expectsError({ message: 'fhqwhgads' }));
foo.on('error', common.mustCall());
}