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

expect(0) error doesn't have useful stack trace #209

Closed
wycats opened this issue Mar 6, 2012 · 3 comments
Closed

expect(0) error doesn't have useful stack trace #209

wycats opened this issue Mar 6, 2012 · 3 comments

Comments

@wycats
Copy link

wycats commented Mar 6, 2012

When a test has no assertions, QUnit throws "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions".

Because this error is inside QUnit code and not test code, the exception information is not very useful. At first glance, it seems like it may be impossible to provide better information, but I'm opening this ticket to try to brainstorm a better solution.

@jzaefferer
Copy link
Member

I see no way to add a useful stack trace in this case. In af27eae I actually remove the useless trace for unmatched expect and expect(0), so that's at least better then pointing to some line inside qunit.js.

@jzaefferer jzaefferer reopened this Mar 13, 2012
@jzaefferer
Copy link
Member

Try to save stacktraces for test() or module() calls when they are made (or rather the one line). When a related test fails where nothing is accessible, use that stored stack.

@jzaefferer
Copy link
Member

Fixed

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

No branches or pull requests

2 participants