Skip to content

Instantly share code, notes, and snippets.

@mantoni
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mantoni/7ecebd3316a6a851e782 to your computer and use it in GitHub Desktop.
Save mantoni/7ecebd3316a6a851e782 to your computer and use it in GitHub Desktop.
Mocha diff shown for thrown Error
describe('diff', function () {
it('is shown with no diff', function () {
var e = new Error();
e.showDiff = true; // because the showDiff fix is not in a release yet
throw e;
});
});
$ npm t
> mocha-diff-bug@1.0.0 test .../mocha-diff-bug
> mocha index.js
diff
1) is not shown
0 passing (8ms)
1 failing
1) diff is not shown:
+ expected - actual
Error
at Context.<anonymous> (.../mocha-diff-bug/index.js:7:13)
{
"name": "mocha-diff-bug",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "mocha index.js"
},
"devDependencies": {
"mocha": "^2.2.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment