test: increase triggerReport() coverage

PR-URL: https://github.com/nodejs/node/pull/26268
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
cjihrig committed 2019-02-26 17:05:11 -05:00
1 parent cae7232e7a
commit 72cf8a3ed6
1 file changed
+14
+14
View File
@@ -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' });
});