Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Return error code 1 when coverage fails #526

Closed
koddsson opened this issue Oct 2, 2015 · 8 comments
Closed

Return error code 1 when coverage fails #526

koddsson opened this issue Oct 2, 2015 · 8 comments

Comments

@koddsson
Copy link

koddsson commented Oct 2, 2015

I've set up jest as a pre-commit hook to make sure to run the tests I have before commit locally. I'd like to keep my coverage up so it would be neat if jest would not return exit code 0 when coverage is less than 100%.

This should probably be behind a command line flag for people that actually want this behavior.

@elliottsj
Copy link

👍 I'm also interested in this feature. It would also be useful to be able to specify arbitrary threshold values like karma-threshold-reporter:

thresholdReporter: {
  statements: 90,
  branches: 60,
  functions: 85,
  lines: 90
}

@cpojer
Copy link
Member

cpojer commented Oct 28, 2015

Agreed! I haven't heard from @koddsson since he initially started his pull request.

@koddsson
Copy link
Author

Sorry! I've been super busy at work but I definitely wanna try to finish off #556 soon. I'm hoping I can get to it this week or at the weekend 🙏

@benweizhu
Copy link

Has this wonderful feature been finished?

Really want to see features like this:

thresholdReporter: {
statements: 90,
branches: 60,
functions: 85,
lines: 90
}

@cpojer
Copy link
Member

cpojer commented Mar 17, 2016

I'm happy to accept pull requests for this feature!

@willyyang
Copy link

I agree with @elliottsj

@cpojer
Copy link
Member

cpojer commented May 16, 2016

This will be part of the 12.1.0 release sometime this week. Thanks to @bookman25 for implementing this feature!

@cpojer cpojer closed this as completed May 16, 2016
ghost pushed a commit that referenced this issue May 17, 2016
Summary:
Added support for specifying global coverage thresholds.  If the thresholds aren't met, then jest should exit code 1.
Closes #924

Differential Revision: D3302385

fbshipit-source-id: d54938d68d845c64d2c8cc66d6d0e0bd8604c57e
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants