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 16// Make sure this is ignored due to the above override. 17process.on('uncaughtException', common.mustNotCall()); 18 19process.on('exit', (code) => { 20 assert.strictEqual(code, 0); 21 // Make sure no reports are generated. 22 const reports = helper.findReports(process.pid, tmpdir.path); 23 assert.strictEqual(reports.length, 0); 24}); 25 26throw error; 27