0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-stream-writable-final-throw.js
Rich Trott 8de858b96d
test: increase coverage for stream writable
Refs: https://github.com/nodejs/node/pull/41433#issuecomment-1009551922

PR-URL: https://github.com/nodejs/node/pull/41486
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-01-17 16:54:40 +00:00

24 lines
416 B
JavaScript

'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());
}