Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: increase getReport() coverage
PR-URL: #26276
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
cjihrig committed Feb 26, 2019
commit 9d44950539e51461ede6fc04b63fb97d033f5468
21 changes: 19 additions & 2 deletions test/node-report/test-api-getreport.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,22 @@ const helper = require('../common/report');
common.expectWarning('ExperimentalWarning',
'report is an experimental feature. This feature could ' +
'change at any time');
helper.validateContent(process.report.getReport());
assert.deepStrictEqual(helper.findReports(process.pid, process.cwd()), []);

{
// 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' });
});