Closed juriejan closed 12 years ago
I added the string matching function to should.throw() and didn't experience the exceptions outputted to console.
If you run the tests
make test
Do you still see the exceptions on the console?
If they are not, can you put together a test case that exposes the bug:
https://github.com/visionmedia/should.js/blob/master/test/should.test.js#L496
Many thanks
After trying to setup a test case I see that the output doesn't print out in the usual cases.
I'm currently trying to write some tests for Connect (https://github.com/senchalabs/connect) and specifically trying to catch a 403 error coming from a test application. It's only when I try to do this type of thing that it still prints out the error. I see though that all the other tests in Connect also still print out their response exceptions, so I guess it's not that bad.
What do you think?
I'm not a expert on connect but I do know that AssertionErrors are explicitly outputted:
https://github.com/senchalabs/connect/blob/1.x/lib/http.js#L209
This may be what is causing your problem. I don't think it is a mocha issue.
That's probably it. Thanks. Just carrying on with things as they are for the time being.
I'm using 'should.throw' in the current fashion:
This catches the exception and passes the test, but the exception still prints out to the console. This doesn't seem right to me. Am I missing something here?