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

Replace nyc with c8. #4

Closed
wants to merge 1 commit into from
Closed

Replace nyc with c8. #4

wants to merge 1 commit into from

Conversation

mattcollier
Copy link
Contributor

No description provided.

@JSAssassin
Copy link
Contributor

JSAssassin commented Dec 3, 2021

c8 isn't working properly. It's showing jsdocs as code, giving a higher % of code coverage. I'll be looking into it.

Update: It's not working, tried it on a small project that uses esm and was getting 100% code coverage even when some of the code weren't tested. This maybe related to this issue which is still open - bcoe/c8#34 where others have reported about the same issue. The latest comment on it was on Apr.

Copy link
Contributor

@dmitrizagidulin dmitrizagidulin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, though yeah, we should investigate how to exclude jsdocs.

"coverage-ci": "cross-env NODE_ENV=test nyc --reporter=lcov npm test",
"coverage-report": "nyc report"
"coverage": "cross-env NODE_ENV=test c8 --reporter=lcov --reporter=text-summary npm test",
"coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcov npm test",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have already been just "lcovonly" since ci only needs the coverage report.

Suggested change
"coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcov npm test",
"coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly npm test",

@davidlehn
Copy link
Member

Is this working?

  • Looking at nyc reports from 1.2.0 I see what looks correct, with a few missing coverage spots in meters.js.
  • The nyc local output seems correct. The index.html shows the same coverage as above.
  • The c8 reports look like they have similar line counts for missing coverage on the index page, but the meters.js page has everything green except for what looks like misplaced missing coverage lines that overlap with docs.
  • The c8 local index.html just shows everything as 100% with every meters.js line having run 2x, including empty lines, comments, docs, etc. So zero missing coverage shown. This is wrong.
  • I don't speak lcov.info, but it's easy to see the nyc and c8 files are very different.

Am I running it wrong or looking at the wrong output?

@davidlehn
Copy link
Member

I tried to add the patch from #6 here. It didn't fix the odd coverage output. I didn't look further. It may be that esm has special nyc support not not c8 support?

@davidlehn
Copy link
Member

I think this can be closed due to #6 being merged. Fixing c8 support can be revisited if needed.

@dlongley
Copy link
Member

dlongley commented Apr 5, 2022

Closing, c8 is now used on the main branch.

@dlongley dlongley closed this Apr 5, 2022
@dlongley dlongley deleted the use-c8 branch April 29, 2022 05:40
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

Successfully merging this pull request may close these issues.

5 participants