Get 0% coverage for JS files after jest v25.2.0
See original GitHub issueIssue :
Get 0% coverage for JS files after jest v25.2.0 ,
my Project:
<ROOT>
|__ jest.config.js
|__ tsconfig.json
|__ index.js
|__ index.d.ts
|__ tests
|__index.test.ts
I just use a TS spec file to test a JS file with a .d.ts
file. Every thing were good until I upgrade jest
up to v25.2.0
Tests were still ok and shown correct locations for any errors. But it failed on coverage
It shown results like
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
----------|---------|----------|---------|---------|-------------------
Expected behavior :
Debug log:
# content of ts-jest.log :
Minimal repo :
My Project is clipy-mate-core
You can run npm run coverage
before and after jest
upgraded.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Why am I getting 0 coverage from Jest when running it from ...
The problem was that jest assumes the configPath to be the root directory and thus doesn't find any files to check the coverage...
Read more >ts-jest | Yarn - Package Manager
A Jest transformer with source map support that lets you use Jest to test projects written in TypeScript. NPM version NPM downloads Known...
Read more >Configuring Jest
If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist for this file...
Read more >jest-coverage-guard - npm
Locally the script will check coverage on all files that you have changed and committed implementing current feature and all files that you...
Read more >Measuring Typescript Code Coverage with Jest and GitHub ...
Running Typescript Tests and Coverage Locally with Jest. Let's get ... Be sure to add the following two lines to the jest.config.js file:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yup, 25.2.4 has a fix for this
tag @SimenB I think this is jest regression, isn’t it ? I saw 25.2.4 release seem to contain something related to this.