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

Generate a failure when QUnit.start is passed a non-numeric argument #846

Closed
gibson042 opened this issue Aug 7, 2015 · 6 comments
Closed

Comments

@gibson042
Copy link
Member

Ref #844

When QUnit.start is passed a truthy but non-numeric argument, its test semaphore decrement sets config.current.semaphore to NaN. Such a condition should generate output analogous to the "Called start() while already started…" failure presented when semaphore dips below zero.

@platinumazure
Copy link
Contributor

I'd love to submit a pull request, but I'm not sure what the best way to handle this situation is. I suppose throwing an exception for an invalid value would make sense, but is there a better way?

@leobalter
Copy link
Member

@platinumazure

You should probably use QUnit.pushFailure with a message argument. Ref: https://github.com/jquery/qunit/blob/master/src/test.js#L297

@jzaefferer
Copy link
Member

@platinumazure is this still something you want to work on?

@platinumazure
Copy link
Contributor

Ack, sorry, I've been busy with a bunch of other things. If anyone wants to jump on this now feel free.

@rdugue
Copy link
Contributor

rdugue commented Oct 18, 2015

Hello, I would like to make a pull request if possible. Should config.current.semaphore be set to a specific value in this case?

@gibson042
Copy link
Member Author

Given that it's already a configuration failure, I don't think the value matters much. But I suppose 0 would let us just get on with the rest of the suite.

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

No branches or pull requests

5 participants