Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

actually fixed :)

TJ Holowaychuk8c5812b093a7
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index d4f63493..40558406 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -322,7 +322,7 @@ function pad(str, len) {
function errorDiff(err, type) {
return diff['diff' + type](err.actual, err.expected).map(function(str){
- if (str.value == '\n') str.value = '<newline>\n';
+ if (/^(\n+)$/.test(str.value)) str.value = Array(++RegExp.$1.length).join('<newline>');
if (str.added) return colorLines('diff added', str.value);
if (str.removed) return colorLines('diff removed', str.value);
return str.value;