https://github.com/drewml/jest-coverage-bug-repro
Minimal repro example for a Jest bug with caching + code coverage
https://github.com/drewml/jest-coverage-bug-repro
Last synced: 9 months ago
JSON representation
Minimal repro example for a Jest bug with caching + code coverage
- Host: GitHub
- URL: https://github.com/drewml/jest-coverage-bug-repro
- Owner: DrewML
- Created: 2018-06-20T16:03:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-20T16:30:35.000Z (almost 8 years ago)
- Last Synced: 2025-07-14T15:07:32.151Z (11 months ago)
- Language: JavaScript
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a boiled down example of a bug with Jest's code coverage reporting, when used in combination with the default caching and a monorepo (Lerna).
## Replicate
1. Clone the repository
2. Run `npm install && npm run bootstrap`
3. Run `npm run test:nocache`, and note in stdout that `project1/index.js` and `project2/index.js` both have 100% coverage. This is the result of running the tests with the `--no-cache` flag
4. Run `npm run test:cache`, and note in stdout we only see code coverage for 1 project. This is the result of running the tests with no flags
5. Run `npm run test:ohno`, and note in stdout we only see code coverage for 1 project. This is the result of running the tests with `--no-cache` and `-i`