-
Notifications
You must be signed in to change notification settings - Fork 781
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
Create an inconclusive assertion #326
Comments
I think QUnit had this at some point. There were more arguments against it, the common response probably being "just add a failing test for something that isn't yet tested". Warnings are too easy to ignore, so why bother? |
While I appreciate the input, I don't think this feature belongs in QUnit. I'm open to other opinions, until then I'll close this issue. |
I think this could be quite useful, or at least something of a custom output might be worth considering. My use case is that we have a bunch of tests against a modular framework and before a test is run we ask the framework if the module is loaded or not. If not then the tests for that module are excluded, however it could also be that the tester expects to see that module so there would be some use in allowing either inconsistent OR something like:
Alternatively (how we currently do it) with the module loaded test outside the test method:
This is not as nice output-wise as the user needs console open. We could create a div on the page to log this sort of thing manually so console is not needed but it would be much nicer in the library itself. Just my two cents. I've been deliberately pseudo-codey up there but you get the picture. |
Great stuff. Thanks! 👍 |
The inconclusive assert would be used as follows:
When run the, the test would display in (say) orange (compared to red for fail and green for pass) , with the provided message or the default "Test pending" message.
We've hacked this together to work for us, here is a snippet that adds a class for the styling.
li.className = assertion.result === null ? "inconclusive" : (assertion.result ? "pass" : "fail");
It would be great if this can be included in the API.
It has proven very useful for creating place-holders for pending tests, and also for frameworks on top of QUnit that iterate an object and flag untested methods.
Thanks.
Noel
The text was updated successfully, but these errors were encountered: