Last active
August 29, 2015 14:18
-
-
Save mantoni/7ecebd3316a6a851e782 to your computer and use it in GitHub Desktop.
Mocha diff shown for thrown Error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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