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.

Coverage incomplete using `projects`

See original GitHub issue

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

Bug

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.

  • All tests run with their correct configuration
  • A single coverage report is created at project root but the coverage is not complete
    • products/product-2 root index.js does not receive coverage, although the test covers it

Sample repo

--------------------------------|----------|----------|----------|----------|----------------|
File                            |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
--------------------------------|----------|----------|----------|----------|----------------|
All files                       |    85.71 |      100 |      100 |    85.71 |                |
 packages/package-1/src         |      100 |      100 |      100 |      100 |                |
  index.js                      |      100 |      100 |      100 |      100 |                |
 packages/package-1/src/example |      100 |      100 |      100 |      100 |                |
  index.js                      |      100 |      100 |      100 |      100 |                |
 packages/package-2             |      100 |      100 |      100 |      100 |                |
  index.js                      |      100 |      100 |      100 |      100 |                |
 packages/package-2/sample      |      100 |      100 |      100 |      100 |                |
  index.js                      |      100 |      100 |      100 |      100 |                |
 products/product-1             |      100 |      100 |      100 |      100 |                |
  index.js                      |      100 |      100 |      100 |      100 |                |
 products/product-1/sample      |      100 |      100 |      100 |      100 |                |
  index.js                      |      100 |      100 |      100 |      100 |                |
 products/product-2             |        0 |      100 |      100 |        0 |                |
  index.js                      |        0 |      100 |      100 |        0 |              1 |
--------------------------------|----------|----------|----------|----------|----------------|

What is the expected behavior?

  • All tests would run with their correct configurations
  • A single coverage report would be created at project root

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

Jest configurations are available in the sample repo. There is a configuration in the root of the repository and configurations also in each project folder for more project-specific stuff.

All coverage configuration is done at root as globalConfig as recommended in https://github.com/facebook/jest/issues/4255

MacOS High Sierra - 10.13.3 node - v9.3.0 yarn -v 1.3.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:23 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
rileylnapiercommented, Feb 6, 2018

i have this same problem too and its been driving me nuts.

possibly something to do with multiple packages that depend on each other using lerna? hmmm not sure

2reactions
nrobertdehaultcommented, Sep 13, 2018

@nerdmax I’m sure that’s not optimal but running all the tests in parallel by passing --maxWorkers=100 fixed the coverage report for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Coverage Results are incomplete
I was able to run all of the test projects individually and then merge their codecoverage results together using the following code. This...
Read more >
Code coverage of multimodule project is incomplete
Hello,. I m facing a issue while generating code coverage using latest SonarQube 8.1, I have a multi-module maven project. main-project:.
Read more >
How to Cope With Incomplete Test Coverage? - QATestLab
First, software testing company specifies the scope of test coverage in such a way to fully cover the system functions.
Read more >
The Biggest Problem with Incomplete Construction Data and ...
The Biggest Problem with Incomplete Construction Data and How to Fix It. by Ibrahim Seif ... So, when you ordered too many supplies...
Read more >
SonarQube: Coverage incomplete on multimodule gradle ...
How can I modify my build process to see "cross-module coverage" in SonarQube? I would love to update my project so future visitors...
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