mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
fe292fac55
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>
30 lines
936 B
JavaScript
30 lines
936 B
JavaScript
// 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' });
|
|
});
|