-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actual exception is hidden when doing must.throw('bla bla') #4
Comments
Hey! Thanks for pointing this out and nudging me to do something about it! I've been annoyed by this too recently — just haven't dealt with it. :-) I'll have to figure something out which would work well with test runners. |
I've actually ended up doing a try-catch myself in tests to have more fine grained assertions on errors. var err
try { something() } catch (ex) { err = ex }
err.must.be.an.instanceof(Error)
err.code.must.equal(404) Do you have any suggestions or should we just close this issue until we come up with a better idea? Thanks! |
Do whatever you think is reasonable, mate. :) As I'm not using your module. Sorry. |
Fair enough. Do check out the latest Promise support if you're into that sort of thing. ^_^ |
Oh, I actually noticed you did propose a solution in https://github.com/moll/js-must/pull/7/files. Thanks! |
Ha, I forgot. Sorry. :-) On Mon, 15 Jun 2015 18:45 Andri Möll [email protected] wrote:
|
My assertion looks like this:
If myFunction throws a different exception
(like
TypeError: Cannot read property 'myProperty' of null
)the must.js hides it from me.
It would be beneficial to see the actual exception stack trace while debugging a test.
The text was updated successfully, but these errors were encountered: