Skip to content

Commit

Permalink
test: increase coverage for stream writable
Browse files Browse the repository at this point in the history
Refs: #41433 (comment)

PR-URL: #41486
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
Trott authored and BethGriggs committed Jan 24, 2022
1 parent 31d75f2 commit c0aec67
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/parallel/test-stream-writable-final-throw.js
@@ -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());
}

0 comments on commit c0aec67

Please sign in to comment.