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.

Incorrect coverage when running in nested folder

See original GitHub issue

Do you want to request a feature or report a bug? Bug

What is the current behavior?

  • jest doesn’t collect coverage files correctly when collectCoverageFrom is not specified
  • even when collectCoverageFrom is specified the report is incorrect

If moving jest and configuration to root, works as expected

**If the current behavior is a bug, please provide the steps to reproduce and https://github.com/federicobarera/jest-coverage-repro

(master) not-working (correct) working

What is the expected behavior? Correct coverage

Please provide your exact Jest configuration Included in the repo

Run npx envinfo --preset jest in your project directory and paste the results here

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
federicobareracommented, Oct 17, 2018

Hey, just a heads up, we managed to fix the ‘issue’ changing the rootDir back to the real root of the project (and re adjusting the other paths accordingly).

We also noticed that other tools tend not to work as expected when the config files / runners are not in root (eg. babylon-jest). It might just be a non common folder structure.

0reactions
github-actions[bot]commented, May 12, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting incorrect coverage report for no matter what module ...
I am trying to use coverage to track code coverage while running ... ignore_errors=False [html] directory=/opt/ coverage/coverage_html.
Read more >
Improve Code Quality Using Test Coverage - CODE Magazine
Condition coverage is a measure that tells you whether every Boolean sub-expression within a program has evaluated to both true and false ......
Read more >
Code coverage analysis data ignored for source files
I am facing a problem with generating a coverage report for our ... I am running “ceedling gcovr” in the sub-folders of the...
Read more >
Full code-coverage with Jest - tsmx
js in the main folder of your NodeJS project. Covering your code with Jest. Initial setup and test function touch. To get Jest...
Read more >
Triple combined code coverage for React Apps with Jest ...
"Engineering is about assuming stuff will go wrong and learn from that ... Run the component tests with yarn cy:run-ct . coverage-cy folder...
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