-
Notifications
You must be signed in to change notification settings - Fork 783
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
Global failure: Trying to do a test run with zero assertions fails #1405
Comments
Thanks for reporting this. When a test suite contains actual tests, but uses |
@Krinkle That's awesome, thank you for reproducing this. If I can help with contributing, feel free to let me know! |
@jayjayjpg Patch is welcome! What it comes down to is that we currently determine "No tests run" based on assertions. Look around for
I would recommend adding a count of tests alongside it, and use that for this purpose instead. |
Tell us about your runtime:
What are you trying to do?
I try to run a test set, e.g. a filtered test set using the
--filter
of the QUnit CLI, that contains zero assertions. Each test case that contains zero assertions is marked as such usingassert.expect(0)
.Why are you trying to do this?
Sometimes I want to write tests which use another assertion library, making the use of QUnit's
assert
obsolete. This might make filtered test runs using--filter
or--module
impossible for certain test sets.Code that reproduces the problem:
Please check out the minimal reproduction of the issue here.
When in the reproduction repository, only running
will run both test files in the test directory. You should see that the test run passes:
To reproduce the error, run
qunit --filter="fail"
You should see that one test file was run, but that the test run fails with
not ok global failure
:If you have any relevant configuration information, please include that here:
What did you expect to happen?
I expect a test run that contains zero assertions to pass without a global failure error as long as I declare these tests with the
assert.expect(0)
method as assertionless.What actually happened?
When trying to run a test and the test run happens to contain in total zero assertions, the run will fail with a global failure error. The number of tests run will be displayed as
passed
and one additional failing assertion is displayed in the test output.The text was updated successfully, but these errors were encountered: