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

Add option to forbid empty test suites #4123

Open
wants to merge 1 commit into
base: master
from
Open

Conversation

@eemeli
Copy link

eemeli commented Dec 8, 2019

Description of the Change

Adds an option forbidEmptySuite, available in the CLI as --forbid-empty-suite, that will fail a suite with an error Empty suite forbidden if it contains no tests.

Alternate Designs

A similar result could be achieved by an individual customised reporter, but that seems like the wrong layer at which to address this.

Why should this be in core?

Because the other options are also defined in the core.

Benefits

At the moment, if the test definitions fail in a context that does not fail a subsequent mocha.run() (e.g. a browser processing multiple <script> tags), this failure may not be caught by Mocha, and instead it will erroneously display a positive result with "0 passing" tests. This is problematic in particular in CI tests, where the results are often left unchecked if they "pass".

Possible Drawbacks

This adds yet another option.

Applicable issues

Fixes #4062

@jsf-clabot

This comment has been minimized.

Copy link

jsf-clabot commented Dec 8, 2019

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.