-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
suppresses thrown errors #218
Comments
mocha should display exceptions thrown, not if you |
Yeah, I'm unable to repro this - I've changed a number of things and something along the way fixed this problem. Part of the problem may have been that in some cases I was throwing strings instead of Error objects. If you're printing e.stack, that would of course produce no output for a string. If I hit this problem again I'll post an update. |
oh, yeah dont throw strings http://www.devthought.com/2011/12/22/a-string-is-not-an-error/, they're useless |
Code that I'm testing throws an error. This error does not appear in the test output, making it difficult to determine why the test failed. It would be much more helpful if mocha always listed the stacktrace of any errors thrown during a test.
This test (along with others):
it ("creates the top-level object", function () {
var result = fillObjectTree.fillObjectTree (dataSet1, example);
result.id.should.equal (1001);
});
Produces:
✖ 17 of 58 tests failed:
fill_object_tree createMap fillObjectTree creates the top-level object:
fill_object_tree createMap fillObjectTree creates the measurableQuantity:
Note the lack of detail under the failed test.
If I wrap the test code in a try/catch, it outputs the error in the console output:
ERROR The provided object to fill (object) does not match the example object map's type (array) at path [.measurableQuantity.unitConversions], Error
The text was updated successfully, but these errors were encountered: