Skip to content

Commit

Permalink
test: increase triggerReport() coverage
Browse files Browse the repository at this point in the history
PR-URL: #26268
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
cjihrig authored and addaleax committed Mar 1, 2019
1 parent a382b52 commit 33fe892
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/node-report/test-api-nohooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,17 @@ function validate() {
helper.validate(filename);
fs.unlinkSync(filename);
}

// Test with an invalid file argument.
[null, 1, Symbol(), function() {}].forEach((file) => {
common.expectsError(() => {
process.report.triggerReport(file);
}, { code: 'ERR_INVALID_ARG_TYPE' });
});

// Test with an invalid error argument.
[null, 1, Symbol(), function() {}, 'foo'].forEach((error) => {
common.expectsError(() => {
process.report.triggerReport('file', error);
}, { code: 'ERR_INVALID_ARG_TYPE' });
});

0 comments on commit 33fe892

Please sign in to comment.