Option to fail if there are skipped tests
See original GitHub issue🚀 Feature Proposal
Add a CLI option to fail if there are any skipped tests. This option would be a boolean,
possibly called disallowSkipping, or something like this.
Motivation
Skipping tests is really useful when maintaining tests, however, sometimes, a skipped test may be committed and pushed to the repository.
It’d be really useful if there was a CLI argument to fail the tests if there are any skipped tests. This argument would then be configured in the hooks and possibly in the CI to ensure all tests are running.
Example
$ jest --disallowSkipping
Pitch
Recently we had a test flagged with .only finding its way all the way to the develop branch because the developer committed the test file with it. We then had two other developers, including myself, reviewing that PR and also we didn’t realise that only that test case was being run for the whole file. Of course that was an oversight on our end, but we’re all subject to pressure to deliver.
Much to my surprise, there isn’t any options to disallowing skipped test cases or to ignore skipping altogether. Although there might be arguments for both cases, I believe to be cleaner to fail the tests if there are any being skipped than to ignore skipping because it’d force the code owner to actually fix the commit and remove the skip rule.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:6 (2 by maintainers)

Top Related StackOverflow Question
This type of feature is best implemented as a lint rule; and already has been.
no focused tests: https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/no-focused-tests.md
a variety of other rules: https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.