1// Flags: --report-uncaught-exception 2'use strict'; 3// Test report is suppressed on uncaught exception hook. 4const common = require('../common'); 5const assert = require('assert'); 6const helper = require('../common/report'); 7const tmpdir = require('../common/tmpdir'); 8const error = new Error('test error'); 9 10tmpdir.refresh(); 11process.report.directory = tmpdir.path; 12 13// First, install an uncaught exception hook. 14process.setUncaughtExceptionCaptureCallback(common.mustCall()); 15// Do not install process uncaughtException handler. 16 17process.on('exit', (code) => { 18 assert.strictEqual(code, 0); 19 // Make sure no reports are generated. 20 const reports = helper.findReports(process.pid, tmpdir.path); 21 assert.strictEqual(reports.length, 0); 22}); 23 24throw error; 25