lib/formatErrors.js
function diffToMessage(diffedAssertionError) {
    var diff = diffedAssertionError.diff;
    var actual = "";
    var expected = "";
    for (var i = 0; i < diff.length; i++) {
        var diffType = diff[i][0];
        if (diffType === 1) {
            if (actual.length > 0) {
                actual += ", ";
            }
            actual += "\"" + diff[i][1] + "\"";
        } else if (diffType === -1) {
            if (expected.length > 0) {
                expected += ", ";
            }
            expected += "\"" + diff[i][1] + "\"";
        }
    }
    var message = "Differences: ";
    if (expected.length > 0) {
        message += "'expected': " + expected;
    }
    if (actual.length > 0) {
        if (expected.length > 0) {
            message += ", ";
        }
        message += "'actual': " + actual;
    }
    message += "\n";
    return  getMessages(diffedAssertionError).join(" ") + "\n" + message;

}
function diffToMessage(diffedAssertionError) {
    var diff = diffedAssertionError.diff;
    var actual = "";
    var expected = "";
    for (var i = 0; i < diff.length; i++) {
        var diffType = diff[i][0];
        if (diffType === 1) {
            if (actual.length > 0) {
                actual += ", ";
            }
            actual += "\"" + diff[i][1] + "\"";
        } else if (diffType === -1) {
            if (expected.length > 0) {
                expected += ", ";
            }
            expected += "\"" + diff[i][1] + "\"";
        }
    }
    var message = "Differences: ";
    if (expected.length > 0) {
        message += "'expected': " + expected;
    }
    if (actual.length > 0) {
        if (expected.length > 0) {
            message += ", ";
        }
        message += "'actual': " + actual;
    }
    message += "\n";
    return  getMessages(diffedAssertionError).join(" ") + "\n" + message;

}
function diffToMessage ( diffedAssertionError ) { var diff = diffedAssertionError . diff ; var actual = "" ; var expected = "" ; for ( var i = 0 ; i < diff . length ; i ++ ) { var diffType = diff [ i ] [ 0 ] ; if ( diffType === 1 ) { if ( actual . length > 0 ) { actual += ", " ; } actual += "\"" + diff [ i ] [ 1 ] + "\"" ; } else if ( diffType === - 1 ) { if ( expected . length > 0 ) { expected += ", " ; } expected += "\"" + diff [ i ] [ 1 ] + "\"" ; } } var message = "Differences: " ; if ( expected . length > 0 ) { message += "'expected': " + expected ; } if ( actual . length > 0 ) { if ( expected . length > 0 ) { message += ", " ; } message += "'actual': " + actual ; } message += "\n" ; return getMessages ( diffedAssertionError ) . join ( " " ) + "\n" + message ; }
Given an AssertionError that has had diffs applied - and that means it has a diff property - provide the message
for the AssertionError including details of the diffs.

@method diffToMessage
@private
@param {AssertionError} diffedAssertionError an AssertionError that has a diff property containing diffs between the expected and
actual values
@return {String} the message that includes diff details
Given an AssertionError that has had diffs applied - and that means it has a diff property - provide the message for the AssertionError including details of the diffs .