aboutsummaryrefslogtreecommitdiff
path: root/test/report/test-report-getreport.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-getreport.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-getreport.js')
-rw-r--r--test/report/test-report-getreport.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/report/test-report-getreport.js b/test/report/test-report-getreport.js
new file mode 100644
index 0000000000..9f40e61c2e
--- /dev/null
+++ b/test/report/test-report-getreport.js
@@ -0,0 +1,29 @@
+// Flags: --experimental-report
+'use strict';
+const common = require('../common');
+common.skipIfReportDisabled();
+const assert = require('assert');
+const helper = require('../common/report');
+
+common.expectWarning('ExperimentalWarning',
+ 'report is an experimental feature. This feature could ' +
+ 'change at any time');
+
+{
+ // Test with no arguments.
+ helper.validateContent(process.report.getReport());
+ assert.deepStrictEqual(helper.findReports(process.pid, process.cwd()), []);
+}
+
+{
+ // Test with an error argument.
+ helper.validateContent(process.report.getReport(new Error('test error')));
+ assert.deepStrictEqual(helper.findReports(process.pid, process.cwd()), []);
+}
+
+// Test with an invalid error argument.
+[null, 1, Symbol(), function() {}, 'foo'].forEach((error) => {
+ common.expectsError(() => {
+ process.report.getReport(error);
+ }, { code: 'ERR_INVALID_ARG_TYPE' });
+});