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

Failure when coverage threshold not met #3554

Conversation

andreffvalente
Copy link
Contributor

Fixes #3520

Fixed async calls to each reporter onRunComplete method

Summary

Whenever the coverage is enabled, jest exits with 0 even if the threshold requirements are not met.

The Coverage reporter will not return a resolved promise when collectCoverageFrom matches files and consequently the Dispatcher will resolve the onRunComplete promise before collecting the result from reporter.

Andre Valente added 2 commits May 11, 2017 15:47
See: jestjs#3520

Fixed async calls to each reporter onRunComplete method
@cpojer
Copy link
Member

cpojer commented May 11, 2017

This is great! Could you add an integration test in the integration_tests folder.

@andreffvalente
Copy link
Contributor Author

Sure, I will look into it.

@codecov-io
Copy link

Codecov Report

Merging #3554 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3554   +/-   ##
=======================================
  Coverage   62.28%   62.28%           
=======================================
  Files         181      181           
  Lines        6714     6714           
  Branches        6        6           
=======================================
  Hits         4182     4182           
  Misses       2529     2529           
  Partials        3        3
Impacted Files Coverage Δ
packages/jest-cli/src/ReporterDispatcher.js 41.17% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4db404...58f6b2b. Read the comment docs.

@aaronabramov
Copy link
Contributor

this is awesome! thank you!
i added a test here #3557

@aaronabramov aaronabramov merged commit 3256e15 into jestjs:master May 12, 2017
@andreffvalente andreffvalente deleted the failure-when-coverage-threshold-not-met branch May 12, 2017 18:57
orta pushed a commit to orta/jest that referenced this pull request Jul 7, 2017
* Return failure when coverage threshold isn’t met

See: jestjs#3520

Fixed async calls to each reporter onRunComplete method

* Run prettier
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* Return failure when coverage threshold isn’t met

See: jestjs#3520

Fixed async calls to each reporter onRunComplete method

* Run prettier
@github-actions
Copy link

This pull request 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 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return exit code 1 if coverage threshold requirements are not met on jest@20.0.0
5 participants