Skip to content

Instantly share code, notes, and snippets.

@mantoni
Last active August 29, 2015 14:18
Show Gist options
  • 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
> [email protected] 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