busterjs / buster

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

(browser) exception reporting #253

Open faassen opened 12 years ago

faassen commented 12 years ago

buster exception reporting will report 'undefined' unless an exception complies with buster.js by having a 'name' property. To display a message it also must have a 'message' property. This makes debugging difficult.

With qunit, I was used to providing a toString() method for my exception that would help display it, but buster.js seems to completely ignore that. Can we add that?

Could we make buster.js report on non-confirming error messages a bit better in general?

cjohansen commented 12 years ago

Yes, we can!

faassen commented 12 years ago

I discovered since then that busterjs is doing the right thing expecting a 'name' and 'message' in error messages, and JS doesn't let you find out much about random objects to report on them. Still it's better to handle non-conforming exceptions a bit better by trying toString() if 'name' and 'message' are missing as I suggested.

Morriz commented 12 years ago

Is there a fix for this yet? I tried some mods, but they all killed the script. This wouldn't work:

[line 607] if (exception && err && (err+'' != exception+'' || err.name != exception)) {

cjohansen commented 12 years ago

I haven't gotten around to it yet.

On Wed, Sep 5, 2012 at 12:55 AM, Maurice Faber notifications@github.comwrote:

Is there a fix for this yet? I tried some mods, but they all killed the script. This wouldn't work:

[line 607] if (exception && err && (err+'' != exception+'' || err.name != exception)) {

— Reply to this email directly or view it on GitHubhttps://github.com/busterjs/buster/issues/253#issuecomment-8281966.

oliamb commented 11 years ago

I'd wanted to fix this things but I cannot found where the repository of buster-assertions is hosted. The URL in package.json reference wrong location. I will make a different issue for this but can someone indicate me the current repository of buster-assertions?

cjohansen commented 11 years ago

@oliamb Sorry about that, it is now called referee

oliamb commented 11 years ago

Thank you :-)