Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nyc@15 doesn't report coverage anymore #1512

Closed
ericmorand opened this issue Feb 20, 2023 · 1 comment
Closed

nyc@15 doesn't report coverage anymore #1512

ericmorand opened this issue Feb 20, 2023 · 1 comment

Comments

@ericmorand
Copy link

A few hours ago, nyc@15 stopped reporting coverage at all, without any change to our projects.

To illustrate the issue, I created a repository:

https://github.com/ericmorand/nyc-issue

It comes with two branches: main, fueled by nyc@14; nyc-15 fueled by nyc@15.

To run the coverage script, just execute npm t.

  • main
----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |       80 |       50 |      100 |       75 |                   |
 foo.ts   |       80 |       50 |      100 |       75 |                 3 |
----------|----------|----------|----------|----------|-------------------|
  • nyc-15
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 |                   
----------|---------|----------|---------|---------|-------------------

I strongly suspect that this is due to the release of @babel/core, which istanbul-lib-instrument depends on and that was upgraded to 7.21.0 a few hours ago, but I'm still investigating.

@ericmorand
Copy link
Author

ericmorand commented Feb 21, 2023

As suspected, the issue was coming from babel - but namely from@babel/generator@7.21.0 that came with a bug related to source maps:

babel/babel#15444

It was fixed in @babel/generator@7.21.1, which is now installed alongside nyc@15, which fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant