Skip to content

Minimal repro example for a Jest bug with caching + code coverage

Notifications You must be signed in to change notification settings

DrewML/jest-coverage-bug-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Minimal repro example for a Jest bug with caching + code coverage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published