• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4const assert = require('assert');
5const stream = require('stream');
6
7process.on('uncaughtException', common.mustCall((err) => {
8  assert.strictEqual(err.message, 'kaboom');
9}));
10
11const writable = new stream.Writable();
12
13writable._write = (chunk, encoding, cb) => {
14  cb();
15};
16writable._final = (cb) => {
17  cb(new Error('kaboom'));
18};
19
20writable.write('asd');
21writable.end(common.mustCall((err) => {
22  assert.strictEqual(err.message, 'kaboom');
23}));
24