Coverage incomplete using `projects`
See original GitHub issueDo 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
--------------------------------|----------|----------|----------|----------|----------------|
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:
- Created 6 years ago
- Reactions:12
- Comments:23 (1 by maintainers)
Top GitHub Comments
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
@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.