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.

Typescript coverage doesn't include some lines after 13.2.0 update

See original GitHub issue

Link to bug demonstration repository.

https://github.com/damyanpetev/typescript-coverage-repro (install nyc@latest to see the difference)

Expected Behavior

Coverage report on a TypeScript project to include all relevant lines and if/else paths.

Observed Behavior

After updating v13.1.0 to latest (specifically above v13.2.0) coverage percents differ and seem to ignore some lines (specifically noticed that with if/else blocks). Consequently, the coverage also doesn’t report the if/else paths that are not taken: image

Forensic Information

Operating System: Windows 10 Environment Information: tested on both node v8.15.1/v10.15.2 with npm 6.4.1. (initial commit on demo repo has package-lock.json with packages installed)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
fictitiouscommented, Apr 26, 2019

Can’t say for the original report, but my problem is gone with nyc@14.1.0. Thanks!

0reactions
coreyfarrellcommented, Apr 24, 2019

@damyanpetev @fictitious please retest with nyc@14.1.0 (currently published to npm next tag). This should resolve the issue for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nyc processing files not covered by include when `all ... - GitHub
After updating to 13.2.0 , I'm still getting inconsistent data back on subsequent runs. > nyc npm test ======== ...
Read more >
Jest finds tests but doesn't collect coverage - Stack Overflow
The quick fix I said in my comment, using --watchAll instead, eg: react-scripts test --coverage --watchAll . Just for future reference, ...
Read more >
Changelog - Cypress Documentation
If the user logs in to the Dashboard from the app, but the current project does not have a project ID, the user...
Read more >
nyc | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Javascript/Typescript test coverage - SonarQube Documentation
However, SonarQube does not generate the coverage report itself. Instead, you must set up a third-party ... Simply add the following to your...
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