visionmedia/mocha — Issue #249: Tests that are supposed to throw exceptions - feedback
Author: satazor
Created: 2012-02-03 09:34:54+00:00
State: open

I have a project that does a lot of validations, and if something wrong happens an error is thrown.
Thing is that throwException() does not give any feedback about the error caught. If I accidentally call an undefined method inside the code being tested, it passes because it was expected to throw an error. To solve this, we could somehow output the error message that was thrown (maybe an option that would activate this behaviour) so the user could verify if the error message is correct.

I don't know if this is an issue with mocha or with the assert libraries themselves (I'm using expect.js).