summaryrefslogtreecommitdiff
path: root/test/report/test-report-uncaught-exception.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-02-28 20:54:35 -0500
committercjihrig <cjihrig@gmail.com>2019-03-02 21:17:19 -0500
commitfe292fac55c2b41432db2c326fe40ae154a1ab21 (patch)
tree659b2ae6022f0077b5acf9d83bf6657fabea79e3 /test/report/test-report-uncaught-exception.js
parent060af324ae7093a390edd1524855d7679ce6837b (diff)
downloadandroid-node-v8-fe292fac55c2b41432db2c326fe40ae154a1ab21.tar.gz
android-node-v8-fe292fac55c2b41432db2c326fe40ae154a1ab21.tar.bz2
android-node-v8-fe292fac55c2b41432db2c326fe40ae154a1ab21.zip
test: rename node-report suite to report
This commit renames the "node-report" test suite to "report" in order to begin differentiating core's diagnostic reporting from the original node-report module on npm PR-URL: https://github.com/nodejs/node/pull/26371 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/report/test-report-uncaught-exception.js')
-rw-r--r--test/report/test-report-uncaught-exception.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/report/test-report-uncaught-exception.js b/test/report/test-report-uncaught-exception.js
new file mode 100644
index 0000000000..b3da7c4244
--- /dev/null
+++ b/test/report/test-report-uncaught-exception.js
@@ -0,0 +1,24 @@
+// Flags: --experimental-report --diagnostic-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.setOptions({ path: 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;