Skip to content
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

throw null #6

Open
dominictarr opened this issue Nov 27, 2010 · 2 comments
Open

throw null #6

dominictarr opened this issue Nov 27, 2010 · 2 comments

Comments

@dominictarr
Copy link
Collaborator

if null is thrown, it's it ends the test, but does not count as an error!

you get a passing test!

in javascript you can throw ANYTHING

@bentomas
Copy link
Owner

We absolutely don't check instanceof Error anywhere, nor do we say if(err) in the errorHandling code. So something else is going on.

@dominictarr
Copy link
Collaborator Author

it's mainly in the reporting end of things: lib/console-runner 236
var r = tests[i];
if (r.failure) {
var s = r.failure.stack ? r.failure.stack.split("\n"): ['no stack trace']

also, lib/testing 206

  if (test.failure) {
    test.failureType = test.failure instanceof assert.AssertionError ? 'assertion' : 'error';

a lot of that code breaks if a non Error is thrown, usually a property of null error when you try to say failure.stack.length, and failure is a string, and has no stack property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants