Add flag to ignore test suites that fail to run
See original GitHub issue🚀 Feature Proposal
Add a flag that lets you ignore test suites (files) that failed to run instead of reporting them as failed.
It should not ignore tests that ran and failed.
Motivation
Make it easier to run one test suite and see the results when there are compile issues in the other test files that I want to ignore. I’m using TypeScript but suspect JS projects have the same behaviour.
When making a change that affects lots of files, I usually get the functionality working and then start fixing (and running) my unit tests one at a time. I run them one-by-one using the --testNamePattern= flag. The issue is that when you move/remove/rename a class, it breaks import statements in many tests and jest marks those tests as failed even if you’re not targeting them. Same behaviour when you use --runTestsByPath.
This makes it difficult to see the results of the one test that you’re interested in when there are 20 other failures.
Example
jest --ignoreFailedToRun -t="The test that I want to run"
Pitch
This would make jest easier to work with and the desired behaviour can’t be achieved without changing jest (AFAIK).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:8 (1 by maintainers)

Top Related StackOverflow Question
I’m not a fan, too easy to leave it in the npm script and you end up with evergreen tests.
say I have 100 test cases, adding this flag can tell me 15 out of 100 is failing which is very useful, why can’t jest do that? seems like a typical feature for other unit test harness, statistics matter when you have a large code base.