Skip to content

Commit 33fe892

Browse files
cjihrigaddaleax
authored andcommitted
test: increase triggerReport() coverage
PR-URL: #26268 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a382b52 commit 33fe892

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/node-report/test-api-nohooks.js

+14
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,17 @@ function validate() {
6767
helper.validate(filename);
6868
fs.unlinkSync(filename);
6969
}
70+
71+
// Test with an invalid file argument.
72+
[null, 1, Symbol(), function() {}].forEach((file) => {
73+
common.expectsError(() => {
74+
process.report.triggerReport(file);
75+
}, { code: 'ERR_INVALID_ARG_TYPE' });
76+
});
77+
78+
// Test with an invalid error argument.
79+
[null, 1, Symbol(), function() {}, 'foo'].forEach((error) => {
80+
common.expectsError(() => {
81+
process.report.triggerReport('file', error);
82+
}, { code: 'ERR_INVALID_ARG_TYPE' });
83+
});

0 commit comments

Comments
 (0)