Getting all "Unknown% ( 0/0 )" in coverage results
See original GitHub issueEnvironment
-
node -v
: v10.13.0 -
npm -v
: 6.4.1 -
npm ls jest
ornpm ls react-scripts
(if you haven’t ejected): jest@24.1.0 -
your vscode-jest settings if customized:
- jest.pathToJest? Do not have
- jest.pathToConfig? Do not have
- in jest.config.js:
collectCoverage: true, collectCoverageFrom: [‘ClientApp/src/**/*.{js,vue}’], coverageReporters: [‘text-summary’], - in settings.json: “jest.rootPath”: “web”, “jest.debugMode”: true, “jest.showCoverageOnLoad”: true,
-
Operating system: Windows 10
Prerequisite
- are you able to run jest test from command line? yes
- how do you run your tests from command line? (for example:
npm run test
ornode_modules/.bin/jest
) These all work well, showing code coverage summary with interesting results: npm run test npm test – --coverage node node_modules/jest/bin/jest.js
Steps to Reproduce
Start VS Code with a solution with tests. Run the tests by the command “Jest: Start Runner” in VS Code. Look into the Jest output window and see the tests run.
Relevant Debug Info
I get no errors or issues in the Jest output window or in the developer console.
Expected Behavior
Tests run and pass/fail appropriately in VS Code, and I should get a coverage report in the Jest output window with meaningful results
Actual Behavior
Tests run and pass/fail appropriately in VS Code, but I get:
=============================== Coverage summary ===============================
Statements : Unknown% ( 0/0 )
Branches : Unknown% ( 0/0 )
Functions : Unknown% ( 0/0 )
Lines : Unknown% ( 0/0 )
================================================================================
(This also prevents me from seeing any red highlights for coverage in VS Code text editors.)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:8
Top Results From Across the Web
Karma , Istanbul - code coverage report Unknown% ( 0/0 )
When the coverage is Unknown% that means you've probably enabled it correctly. Make sure the ...
Read more >Python coverage always unknown - GitLab CI/CD
Hey, I am trying to make test coverage work for a python project. And I simply cannot figure out why there is no...
Read more >Generic code coverage report refers to a file with an unknown ...
When trying to upload an object-C/Swift project, the sonar scanner returns error with Line 2 of report refers to a file with an...
Read more >Code Coverage - Cypress Documentation
If you are unfamiliar with code coverage or want to learn more, ... and get instrumented code without an intermediate folder, but the...
Read more >These medical bills are now banned. What to do if you get one ...
Sometimes insurers offer partial out-of-network coverage but leave ... ER or gets care at an in-network hospital, they should examine all ...
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
I had the same issue, running
npm test -- --coverage
resulted in 0 statements found in the text report.But by simply adding the CI=1 environment variable so jest does not run in interactive mode, it produced the expected coverage reports:
CI=1 npm test -- --coverage
Same issue here, I am using CRA with Typescript and rescripts.
Dependencies
Jest config
Result: