Skip to content

Commit

Permalink
Fix error mssage indentation
Browse files Browse the repository at this point in the history
not to affect msg when diff
  • Loading branch information
2kindsofcs committed Aug 16, 2019
1 parent f9d8606 commit 4d446e6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/reporters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,12 @@ exports.list = function(failures) {
color('error title', ' %s) %s:\n%s') + color('error stack', '\n%s\n');
var match = message.match(/^([^:]+): expected/);
msg = '\n ' + color('error message', match ? match[1] : msg);

msg += generateDiff(err.actual, err.expected);
} else {
if (msg.includes('\n')) {
var errStrSplit = msg.split('\n');
msg = errStrSplit.join('\n ');
}
}

// indent stack trace
Expand All @@ -257,10 +261,6 @@ exports.list = function(failures) {
}
testTitle += str;
});
if (msg.includes('\n')) {
var errStrSplit = msg.split('\n');
msg = errStrSplit.join('\n ');
}
Base.consoleLog(fmt, i + 1, testTitle, msg, stack);
});
};
Expand Down

0 comments on commit 4d446e6

Please sign in to comment.