visionmedia/mocha — pull request #976 by papandreou (2013-09-12 08:44:55+00:00)
Title: Update diff to 1.0.7 and switch to the new WordsWithSpace diff algorithm

This makes differences in whitespace (eg. CRLF vs LF) show up in the string diffs.

Previously this test

```javascript
it('should show whitespace differences', function () {
var err = new Error();
err.actual = "foo\r\nbar";
err.expected = "foo\rbar";
throw err;
});
```

would result in this output:

1) should show whitespace differences:
actual expected

foo<CR>bar

... which isn't really helpful. With this patch you'll get:

1) should show whitespace differences:
actual expected

foo<CR><CR><LF>
bar

The issue is that jsdiff's `Words` algorithm ignores whitespace differences. https://github.com/kpdecker/jsdiff/pull/22 added a new mode that does what you want in a test framework, namely a word-based diff that doesn't ignore _any_ differences when formatting the output.