busterjs / buster

Abandoned - A powerful suite of automated test tools for JavaScript.
http://docs.busterjs.org
Other
448 stars 37 forks source link

"brief" reporter fails when exception happens outside of test context in browsers #422

Closed dominykas closed 9 years ago

dominykas commented 9 years ago

If an exception is thrown during parsing/init (e.g. due to https://github.com/busterjs/buster-test/blob/master/lib/test-case.js#L19 and invalid testCase or whatever other reason), brief reporter will report an incorrect exception like so:

dominykas@patti ~/devel/libs/buster/tmp $ buster-test
Uncaught exception: undefined
Running tests ...
TypeError: uncaughtException listener threw error: Cannot read property 'description' of undefined
    at Object.module.exports.uncaughtException (/Users/dominykas/devel/libs/buster/busterDevEnv/buster-test/lib/reporters/brief.js:334:42)

https://github.com/busterjs/buster-test/blob/master/lib/reporters/brief.js#L334 needs a check that getEnv(this.runtimes, e) is actually valid.

I'll probably PR later, if no one gets around to do this.

cjohansen commented 9 years ago

Fixed by https://github.com/busterjs/buster-test/pull/27