Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot disable diffs - err.showDiff not working #810

Closed
vjpr opened this issue Apr 13, 2013 · 0 comments · Fixed by #1029
Closed

Cannot disable diffs - err.showDiff not working #810

vjpr opened this issue Apr 13, 2013 · 0 comments · Fixed by #1029

Comments

@vjpr
Copy link

vjpr commented Apr 13, 2013

When err.showDiff is false it does not prevent a diff being shown.

Here is the only place where showDiff is being used in Mocha:

    // msg
    var err = test.err
      , message = err.message || ''
      , stack = err.stack || message
      , index = stack.indexOf(message) + message.length
      , msg = stack.slice(0, index)
      , actual = err.actual
      , expected = err.expected
      , escape = true;

    // explicitly show diff
    if (err.showDiff) {
      escape = false;
      err.actual = actual = JSON.stringify(actual, null, 2);
      err.expected = expected = JSON.stringify(expected, null, 2);
    }

I think its just been overlooked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant