question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No coverage being generated in 14.1.0

See original GitHub issue

The 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

  1. npm i
  2. npm run build
  3. npm 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: false in 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
coreyfarrellcommented, May 6, 2019

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 include and exclude were reprocessed. I just updated it to also say extension.

The plan is that nyc@15 will enable --extension=.ts by default but this is a potentially breaking change so it can’t happen to nyc@14.

0reactions
Codex-commented, May 7, 2019

Fair enough, cheers.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found