Skip to content

Commit

Permalink
Change errorDiff()
Browse files Browse the repository at this point in the history
  • Loading branch information
38elements committed Oct 9, 2017
1 parent f8a26f1 commit 6862867
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/reporters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ function pad (str, len) {
* @return {string} Diff
*/
function inlineDiff (err) {
var msg = errorDiff(err, 'WordsWithSpace', false);
var msg = errorDiff(err);

// linenos
var lines = msg.split('\n');
Expand Down Expand Up @@ -433,14 +433,10 @@ function unifiedDiff (err) {
*
* @api private
* @param {Error} err
* @param {string} type
* @param {boolean} escape
* @return {string}
*/
function errorDiff (err, type, escape) {
var actual = escape ? escapeInvisibles(err.actual) : err.actual;
var expected = escape ? escapeInvisibles(err.expected) : err.expected;
return diff['diff' + type](actual, expected).map(function (str) {
function errorDiff (err) {
return diff.diffWordsWithSpace(err.actual, err.expected).map(function (str) {
if (str.added) {
return colorLines('diff added', str.value);
}
Expand Down

0 comments on commit 6862867

Please sign in to comment.