Skip to content

Commit

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

PR-URL: nodejs#41486
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
Trott authored and Linkgoron committed Jan 31, 2022
1 parent 829a7d5 commit 6ba3eb8
Showing 1 changed file with 23 additions and 0 deletions.
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());
}

0 comments on commit 6ba3eb8

Please sign in to comment.