Skip to content

Instantly share code, notes, and snippets.

@mroderick
Last active February 24, 2016 09:23
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 mroderick/13370cb625424304f9af to your computer and use it in GitHub Desktop.
Save mroderick/13370cb625424304f9af to your computer and use it in GitHub Desktop.
How can I get mocha to fail on exceptions?
describe('this should cause tests to fail', function(){
// this will cause an exception
// causing mocha to ignore this whole file
var hello = JSON.parse('{"hello":}');
it('should something', function(){
// magic
assert.equal(true, true);
})
});
@mroderick
Copy link
Author

With vanilla Mocha, this works as expected. With mocha + karma + karma-webpack + webpack, it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment