Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test coverage is incomplete after upgrading to patch version 26.4.3 #2080

Closed
jordajm opened this issue Oct 28, 2020 · 4 comments 路 Fixed by #2108
Closed

Test coverage is incomplete after upgrading to patch version 26.4.3 #2080

jordajm opened this issue Oct 28, 2020 · 4 comments 路 Fixed by #2108

Comments

@jordajm
Copy link

jordajm commented Oct 28, 2020

馃悰 Bug Report

After upgrading to 26.4.3, test coverage reports began acting strangely. Sometimes they were empty and other times they only contained a few files. Rolling back to 26.4.1 fixed it without making any other changes. Re-installing 26.4.3 without making any other changes brought the problem back again.

To Reproduce

Install 26.4.3 and run tests with the --coverage flag. Notice strange behavior where coverage report ignores most or all files.

Expected behavior

Coverage reports include all expected files

Debug log:

# content of ts-jest.log :
{"context":{"fileName":"/Users/johnjordan/2c/growth-plans-statistics/src/common/service-crud.util.spec.ts","logLevel":20,"namespace":"ts-jest-transformer","package":"ts-jest","transformOptions":{"config":{"automock":false,"cache":true,"cacheDirectory":"/private/var/folders/cy/8hdxsk4j73n6stv8z6t8lktc0000gn/T/jest_dx","clearMocks":false,"coveragePathIgnorePatterns":["node_modules",".args.ts",".input.ts",".dto.ts",".constants.ts",".factory.ts",".entity.ts"],"cwd":"/Users/johnjordan/2c/growth-plans-statistics","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{"computeSha1":false,"throwOnModuleCollision":false},"injectGlobals":true,"moduleDirectories":["node_modules"],"moduleFileExtensions":["js","json","ts"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"name":"d4540e74ca94f518d2391666012842c7","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/Users/johnjordan/2c/growth-plans-statistics/src","roots":["/Users/johnjordan/2c/growth-plans-statistics/src"],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"/Users/johnjordan/2c/growth-plans-statistics/node_modules/jest-environment-node/build/index.js","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":["/node_modules/"],"testRegex":[".spec.ts$"],"testRunner":"/Users/johnjordan/2c/growth-plans-statistics/node_modules/jest-jasmine2/build/index.js","testURL":"http://localhost","timers":"real","transform":[["^.+\\.(t|j)s$","/Users/johnjordan/2c/growth-plans-statistics/node_modules/ts-jest/dist/index.js",{}]],"transformIgnorePatterns":["/node_modules/","\\.pnp\\.[^\\/]+$"],"watchPathIgnorePatterns":[]},"instrument":false,"rootDir":"/Users/johnjordan/2c/growth-plans-statistics/src","supportsDynamicImport":false,"supportsStaticESM":false},"version":"26.4.3"},"message":"computing cache key for /Users/johnjordan/2c/growth-plans-statistics/src/common/service-crud.util.spec.ts","sequence":84,"time":"2020-10-28T05:09:49.799Z"}

envinfo

System:
    OS: macOS 10.15.6
    Node version: v14.1.0

Npm packages:
    jest: 26.6.1
    ts-jest: 26.4.3
    typescript: 4.0.5
    babel(optional): 
@jordajm jordajm added Bug Report Needs Repo Need a minimium repository to reproduce the problem Needs Triage labels Oct 28, 2020
@ahnpnl
Copy link
Collaborator

ahnpnl commented Oct 28, 2020

Hi, would you please clear jest cache and retry ?

@irishtomwalsh
Copy link

For anyone else having this problem you can clear the cache using 'jest --clearCache'

@ahnpnl
Copy link
Collaborator

ahnpnl commented Oct 28, 2020

@irishtomwalsh i was trying to debug this but couldn't find a clear way to reproduce. My Mac always shows correctly. Do you have a clear way to reproduce ?

@jordajm
Copy link
Author

jordajm commented Oct 28, 2020

Yes, jest --clearCache fixed it. Thanks!

@jordajm jordajm closed this as completed Oct 28, 2020
@ahnpnl ahnpnl added Not An Issue Not ts-jest issue and removed Bug Report Needs Repo Need a minimium repository to reproduce the problem Needs Triage labels Oct 28, 2020
@ahnpnl ahnpnl added 馃悰 Bug Confirmed Bug is confirmed Regression 馃挜 and removed Not An Issue Not ts-jest issue 馃悰 Bug Confirmed Bug is confirmed labels Nov 8, 2020
ahnpnl added a commit that referenced this issue Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants