lcov.info is empty after upgrade to v14.
See original GitHub issueLink to bug demonstration repository
https://github.com/tufan-io/node-starter
Installation (nyc@v13)
cd /tmp
git clone https://github.com/tufan-io/node-starter demo-app
cd demo-app
npm install
# ENTER x3 to power through the prompts
It installs all dependencies (slightly dated), but the build passes and reports the proper coverage @100%.
======================= Coverage summary =======================
Statements : 100% ( 2/2 )
Branches : 100% ( 0/0 )
Functions : 100% ( 1/1 )
Lines : 100% ( 2/2 )
=============================================================
Now upgrade to nyc@14 to see the problem
npm i nyc@14
npm run test
======================= Coverage summary =======================
Statements : Unknown% ( 0/0 )
Branches : Unknown% ( 0/0 )
Functions : Unknown% ( 0/0 )
Lines : Unknown% ( 0/0 )
=============================================================
Expected Behavior
A proper coverage report as with nyc@13 after the upgrade to nyc@14
Observed Behavior
with nyc@14, no coverage reports are being generated and the text-summary reports Unknown% ( 0/0 )
lcov.info nyc@13
$ ls -l coverage/lcov.info
-rw-r--r-- 1 sramam wheel 127 Apr 25 14:00 coverage/lcov.info
lcov.info nyc@14
$ ls -l coverage/lcov.info
-rw-r--r-- 1 sramam wheel 0 Apr 25 13:58 coverage/lcov.info
Troubleshooting steps
I have tried to change the package.json:nyc config from
# with nyc@13
"nyc": {
"exclude": [
"config/**/*",
"dist/**/test/**/*.*",
"dist/**/test/**/*.js"
]
}
to (and a couple more alternatives), but to no avail.
# with nyc@14
"nyc": {
"exclude": [
"config/**/*",
"dist/**/test/**/*.*",
"dist/**/test/**/*.js"
],
"include": [
"dist/**/*.js",
"src/**/*.ts"
],
"sourceMap": true,
"instrument": true,
"cache": true,
"all": false
},
What am I missing?
Environment Information
$ npx envinfo@latest --preset nyc
npx: installed 1 in 4.55s
System:
OS: macOS Mojave 10.14.3
CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
Memory: 32.61 MB / 8.00 GB
Binaries:
Node: 11.12.0 - ~/.nvm/versions/node/v11.12.0/bin/node
Yarn: 1.2.1 - ~/.yarn/bin/yarn
npm: 6.5.0 - ~/trial/v1.0.0/demo-app/node_modules/.bin/npm
npmPackages:
nyc: ^14.0.0 => 14.0.0
typescript: ^3.4.5 => 3.4.5
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:11 (3 by maintainers)
Top Results From Across the Web
'npm run coverage' is not updating lcov.info file - Stack Overflow
UPDATE: After sharing the question on Twitter, someone suggested that I add --reporter=lcov to the coverage script and that solved it!
Read more >Sonar reporting 0 coverage despite having lcov.info file
When I run nyc --silent jest --coverage && nyc report --clean --exit it runs the jest tests properly (where there I can see...
Read more >Linux Test Project - Coverage » lcov - SourceForge
This fixes the following problem that can occur when lcov is run using a gcov tool of GCC version 4.7 and above on...
Read more >JavaScript/TypeScript/CSS - SonarQube Documentation
Discover and update the JavaScript/TypeScript properties in ... This would be manifested by analysis getting stuck and the following stack trace might ...
Read more >LCOV - llvm-toolchain.info - lib/Support/Unix/Program.inc
StringRef::npos) 75 4865 : return std::string(Name); 76 : 77 : SmallVector<StringRef, 16> EnvironmentPaths; 78 45195 : if (Paths.empty()) 79 45194 : if ...
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 Free
Top 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

@relief-melone, can you try
indeed! nyc@14.1 seems to work much better.
with
I was able to get