No coverage being generated in 14.1.0
See original GitHub issueThe suggestion here does not resolve this issue, this is not running via ts-node or any other typescript only method of running. In this very basic configuration it’s simply running mocha over the generated *.js files.
Also found no resolution attempting to use various configuration attempted in #1090
Link to bug demonstration repository
https://github.com/Codex-/nyc-bug
Steps to run
npm inpm run buildnpm run test
Test simply executes: nyc --reporter=lcov --reporter=html mocha where mocha is configured to only run *.test.js files.
Expected Behavior
lcov.info to be populated as 13.3.0 does: 13.3.0 lcov.info:
TN:
SF:C:\Dev\p\nyc-bug\src\index.ts
FN:1,testFunc
FNF:1
FNH:1
FNDA:1,testFunc
DA:1,1
DA:2,1
LF:2
LH:2
BRF:0
BRH:0
end_of_record
Observed Behavior
14.1.0 lcov.info: Empty
This occurs with or without the suggested modification to the config --extension='.ts'.
Troubleshooting steps
- still occurring when I put
cache: falsein my nyc config - works correctly when reverting to 13.*
Environment Information
Tested in Linux & Windows
System:
OS: Linux 4.14 Manjaro Linux
CPU: (2) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
Memory: 147.55 MB / 1.95 GB
Binaries:
Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
npm: 5.6.0 - ~/.nvm/versions/node/v8.11.1/bin/npm
npmPackages:
nyc: ^14.1.0 => 14.1.0
typescript: ^3.4.5 => 3.4.5
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
Memory: 18.15 GB / 31.87 GB
Binaries:
Node: 8.12.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.15.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
npmPackages:
nyc: ^14.1.0 => 14.1.0
typescript: ^3.4.5 => 3.4.5
Cheers.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Cannot get code coverage with Cypress + Istanbul
It seems to be an issue in nyc when excludeAfterRemap is true. setting it to false fixed the problem.
Read more >ETSI TR 138 901 V16.1.0 (2020-11)
ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, and conveys no right to...
Read more >kconfiglib - PyPI
The Zephyr project uses Kconfiglib to generate .config files and C headers on Linux as well as Windows. Internals that (mostly) mirror the...
Read more >Code Coverage for End-to-end Tests - Gleb Bahmutov
Our end-to-end test in spec file no-battery.js removes both ... Finally, yet another step generates coverage report from the saved data.
Read more >Xcode 14 Release Notes | Apple Developer Documentation
Xcode no longer builds bitcode by default and generates a warning message if a ... about directives not being supported in symbol source...
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

nyc looks at the source-maps to determine what source produced generated files. This is
--exclude-after-remap, coverage is remapped to the original source filename and then include/exclude/extension matching reprocessed. The purpose of this change is to support testing bundles.Before a minute ago the changelog only mentioned that
includeandexcludewere reprocessed. I just updated it to also sayextension.The plan is that nyc@15 will enable
--extension=.tsby default but this is a potentially breaking change so it can’t happen to nyc@14.Fair enough, cheers.