Is it possible to print the line number of the expect that failed ?
I'm using grunt to launch karma test (jasmine configuration) of my angularjs application).
Currently, the console log show, for example, "Expected true to equal false." and the "describe" and "it" who it comes from... But I have a lot of expect by "it" asset so it's not easy to find the "wrong" line.
Thanks
Stack traces should be available wherever the browser used supports the .stack
property on its errors. I think this has been available in PhantomJS since about v1.6.
It looks like the problem with seeing this in Jasmine is that PhantomJS only creates the stack trace when the error is thrown, and Jasmine doesn't throw errors for failed expectations.
There is a pull request to fix this in Jasmine, but it seems to be closed under the assumption that everything should be better in Jasmine 2.0 which I think is still in release candidate stages.
That leaves three main choices:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With