mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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>
This commit is contained in:
1 parent
f458f1b93b
commit
8de858b96d
1 file changed
+23
@@ -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());
|
||||
}
|
||||
Reference in new issue
Block a user