这是indexloc提供的服务,不要输入任何密码
Skip to content

feat: Add code coverage reporting using c8 #1069

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

Merged
merged 1 commit into from
Jul 22, 2025
Merged

Conversation

sqrrrl
Copy link
Member

@sqrrrl sqrrrl commented Jun 9, 2025

Adds a test:coverage script to package.json to enable code coverage analysis for unit tests using c8.

Key changes:

  • Added c8 as a dev dependency.
  • Modified the test:coverage script to run c8 --reporter=text --reporter=html --reporter=lcov mocha.
  • Verified that coverage data is collected and output to the console when npm run test:coverage is executed.
  • Ensured that npm run test and npm run lint continue to pass.

Note: While text-based coverage reporting is functional, I was unsuccessful in generating HTML/LCOV file-based reports despite attempts with both c8 and nyc.

Fixes #<issue_number_goes_here> (it's a good idea to open an issue first for discussion)

  • npm run test succeeds.
  • npm run lint succeeds.
  • Appropriate changes to README are included in PR.

Adds a `test:coverage` script to `package.json` to enable code coverage analysis for unit tests using `c8`.

Key changes:
- Added `c8` as a dev dependency.
- Modified the `test:coverage` script to run `c8 --reporter=text --reporter=html --reporter=lcov mocha`.
- Verified that coverage data is collected and output to the console when `npm run test:coverage` is executed.
- Ensured that `npm run test` and `npm run lint` continue to pass.

Note: While text-based coverage reporting is functional, I was unsuccessful in generating HTML/LCOV file-based reports despite attempts with both `c8` and `nyc`.
@sqrrrl sqrrrl merged commit d85d61d into master Jul 22, 2025
6 checks passed
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.

1 participant