question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 4 years ago
  • Reactions:6
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
thymikeecommented, Apr 26, 2019

I’m not a fan, too easy to leave it in the npm script and you end up with evergreen tests.

1reaction
laoshawcommented, Dec 18, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to run, ignore or skip Jest tests, suites and files
Ignore a single Jest test in a file using .skip ... See the output, in which we ran 1 test (that didn't have...
Read more >
How to avoid running particular test with -run flag without ...
1. You'd have to write an elaborate regexp which matches anything but the test to exclude. · Does this answer your question? Skip...
Read more >
Build a Jar with Maven and Ignore the Test Results - Baeldung
This quick guide shows how to build a jar with Maven while ignoring the test results. By default, Maven runs unit tests automatically...
Read more >
Maven Surefire Plugin – Skipping Tests
To skip running the tests for a particular project, set the skipTests property to true. <project>; [...] <build>; < ...
Read more >
Jest CLI Options
Alias: -b . Exit the test suite immediately upon n number of failing test suite. Defaults to 1 . --cache ​. Whether ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found