Skip to content

Commit

Permalink
don't change the color() function
Browse files Browse the repository at this point in the history
the color() function is also used by the summary etc.
  • Loading branch information
michael-brade committed May 13, 2020
1 parent b4d7825 commit 926a4ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/reporters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ var color = (exports.color = function(type, str) {
if (!exports.useColors) {
return String(str);
}
str = str.replace(/ /gi, '\u2423;');
return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m';
});

Expand Down Expand Up @@ -391,6 +390,10 @@ function pad(str, len) {
* @return {string} Diff
*/
function inlineDiff(actual, expected) {
// make spaces visible by replacing them with U+2423 (open box char)
actual = actual.replace(/ /gi, '\u2423');
expected = expected.replace(/ /gi, '\u2423');

var msg = errorDiff(actual, expected);

// linenos
Expand Down

0 comments on commit 926a4ed

Please sign in to comment.