-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix mocha junit reporter when running mocha <6
- Loading branch information
1 parent
f14a11a
commit 39ab043
Showing
4 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node_modules/mocha-junit-reporter/index.js b/node_modules/mocha-junit-reporter/index.js | ||
index fbbed2e..de27092 100644 | ||
--- a/node_modules/mocha-junit-reporter/index.js | ||
+++ b/node_modules/mocha-junit-reporter/index.js | ||
@@ -366,7 +366,7 @@ MochaJUnitReporter.prototype.getTestcaseData = function(test, err) { | ||
message = ''; | ||
} | ||
var failureMessage = err.stack || message; | ||
- if (!Base.hideDiff && err.expected !== undefined) { | ||
+ if (!Base.hideDiff && err.expected !== undefined && mocha6plus) { | ||
var oldUseColors = Base.useColors; | ||
Base.useColors = false; | ||
failureMessage += "\n" + Base.generateDiff(err.actual, err.expected); |