Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add new option "fail-zero" #4716

Merged
merged 4 commits into from
Aug 16, 2021
Merged

Add new option "fail-zero" #4716

merged 4 commits into from
Aug 16, 2021

Conversation

juergba
Copy link
Contributor

@juergba juergba commented Aug 12, 2021

Description

We add a new option --fail-zero which exits the test script with exit-code: 1 when no test have been found. Currently the exit-code would be zero. This flag is especially useful for CI/CD environments to prevent bugs remaining undetected.

Description of the Change

New option fail-zero:

  • boolean
  • default: false

Before an EVENT_RUN_END event is emitted, we set runner.failures = 1. That way the script exits with exit-code: 1

Applicable issues

closes #4062

@juergba juergba self-assigned this Aug 12, 2021
@juergba juergba marked this pull request as ready for review August 12, 2021 16:06
@juergba juergba added type: feature enhancement proposal semver-minor implementation requires increase of "minor" version number; "features" labels Aug 12, 2021
@juergba juergba added this to the next milestone Aug 12, 2021
@juergba juergba requested a review from a team August 12, 2021 16:08
lib/runner.js Outdated Show resolved Hide resolved
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
semver-minor implementation requires increase of "minor" version number; "features" type: feature enhancement proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to fail if no tests are run
2 participants