diff --git a/test/node-report/test-api-nohooks.js b/test/node-report/test-api-nohooks.js index 6e7195d6ab8..4ac8f1a9a52 100644 --- a/test/node-report/test-api-nohooks.js +++ b/test/node-report/test-api-nohooks.js @@ -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' }); +});