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

Allow test runs with zero assertions to pass #1449

Closed
wants to merge 2 commits into from

Conversation

jayjayjpg
Copy link
Contributor

@jayjayjpg jayjayjpg commented Jun 21, 2020

Fixes #1405

Previous Behaviour

Before this change, test runs that included tests which had in total zero assertions, would fail with a global error. This made it, f.e. not possible to run test cases leveraging other means of assertions than the QUnit built-ins (assert.ok, assert.equals, etc.)
For a reproduction example, see also the description of the original issue: #1405

New Behaviour

With this change, QUnit will decide if the current test run is "empty" and should therefore fail based on the number of tests included in the run rather than the number of included assertions. This should allow users to run test sets containing zero assertions, as long as respective test cases are marked as such using the assert.expect(0) declaration.

How to Test

Run the new example test case containing no assertions to verify the new behaviourL

bin/qunit.js test/cli/fixtures/zero-assertions.js
before after
image image
@jsf-clabot
Copy link

jsf-clabot commented Jun 21, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@Krinkle Krinkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look pretty good. One potential issue I found, otherwise should land shortly :)

src/test.js Outdated Show resolved Hide resolved
@Krinkle Krinkle self-assigned this Jun 21, 2020
@Krinkle Krinkle closed this in db78338 Jun 22, 2020
@jayjayjpg
Copy link
Contributor Author

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