Skip to content

Commit 9168d01

Browse files
DnnMitkoclayreimann
authored andcommitted
Fixed unhandled promise rejection
Fixed an unhandled promise rejection that appears when a test case fails when calling mocha with this reporter. The error shown was: (node:23553) UnhandledPromiseRejectionWarning: TypeError: input.replace is not a function
1 parent e8b8f7d commit 9168d01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ MochaJUnitReporter.prototype.getTestcaseData = function(test, err) {
318318
var failureMessage = err.stack || message;
319319
var failureElement = {
320320
_attr: {
321-
message: this.removeInvalidCharacters(err.message) || '',
321+
message: this.removeInvalidCharacters(message) || '',
322322
type: err.name || ''
323323
},
324324
_cdata: this.removeInvalidCharacters(failureMessage)

0 commit comments

Comments
 (0)