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

Only enforce coverage threshold across all files #23

Closed
kbrooks opened this issue Nov 10, 2022 · 1 comment
Closed

Only enforce coverage threshold across all files #23

kbrooks opened this issue Nov 10, 2022 · 1 comment

Comments

@kbrooks
Copy link

kbrooks commented Nov 10, 2022

Hey, I found this package while trying to get code coverage working with my sharded jest tests after seeing it mentioned here jestjs/jest#12751. I want to use this project to get the same coverage enforcement we have on our project with jest's built-in coverage reporter, but with the speed of jest shards.

However, it seems like the project forces you to fail the check if any file in the repository is beneath the configured threshold.

Is it possible to add support for the following:

  • Running a coverage check that fails only if coverage is low across all files
  • Creating a coverage summary from the merged coverage
@jcw-
Copy link
Contributor

jcw- commented Mar 29, 2023

Sorry for the delayed response - I completely missed this notification!

I think what you likely want to do is to "accept" the current coverage results of your codebase, which means that each file will have its own "custom threshold", and it will only be allowed to go upwards from there (until it is over the over-all threshold). Brand new files will be subject to the over-all threshold.

Check out step 2 of the "First Run" section in the readme:

Snapshot current coverage errors as legacy exceptions: npm run test:setCoverageExceptionsBaseline

@jcw- jcw- closed this as completed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants