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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
cjihrig committed Feb 26, 2019
1 parent cae7232 commit 72cf8a3
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 72cf8a3

Please sign in to comment.