mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
94adfe9831
In the code base the word `report` is almost only used to refer to the diagnostic report when it's a noun, and it's programmable interface `process.report()` it not prefixed, so `report` should be unambiguous enough to use without `diagnostic`. PR-URL: https://github.com/nodejs/node/pull/27312 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
25 lines
829 B
JavaScript
25 lines
829 B
JavaScript
// Flags: --experimental-report --report-uncaught-exception
|
|
'use strict';
|
|
// Test producing a report on uncaught exception.
|
|
const common = require('../common');
|
|
common.skipIfReportDisabled();
|
|
const assert = require('assert');
|
|
const helper = require('../common/report');
|
|
const tmpdir = require('../common/tmpdir');
|
|
const error = new Error('test error');
|
|
|
|
common.expectWarning('ExperimentalWarning',
|
|
'report is an experimental feature. This feature could ' +
|
|
'change at any time');
|
|
tmpdir.refresh();
|
|
process.report.directory = tmpdir.path;
|
|
|
|
process.on('uncaughtException', common.mustCall((err) => {
|
|
assert.strictEqual(err, error);
|
|
const reports = helper.findReports(process.pid, tmpdir.path);
|
|
assert.strictEqual(reports.length, 1);
|
|
helper.validate(reports[0]);
|
|
}));
|
|
|
|
throw error;
|