Skip to content

🚀 Feature: Exit with code 1 when .only is used by default in CI (--forbid-only) #5299

@nzakas

Description

@nzakas

Feature Request Checklist

Overview

It's an unfortunately common error to check in a test file with .only. This can hide failures especially when run in a CI system where the number of tests is not reported or easily viewable.

Suggested Solution

Automatically fail the test run when a .only is found and emit exit code 1.

(This is the behavior of newer test runners such as the builtin Node.js and Deno runners.)

Alternatives

Using a different testing framework. 😄

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    semver-majorimplementation requires increase of "major" version number; "breaking changes"status: accepting prsMocha can use your help with this one!type: featureenhancement proposal

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions