diff options
Diffstat (limited to 'tests/node_compat/test/parallel/test-stream-writable-final-throw.js')
-rw-r--r-- | tests/node_compat/test/parallel/test-stream-writable-final-throw.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/node_compat/test/parallel/test-stream-writable-final-throw.js b/tests/node_compat/test/parallel/test-stream-writable-final-throw.js new file mode 100644 index 000000000..ba7f87b23 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-writable-final-throw.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 18.12.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'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()); +} |