Skip to content

test: setup code coverage#903

Open
MridulTailor wants to merge 3 commits intonodejs:mainfrom
MridulTailor:feat/setup-code-coverage
Open

test: setup code coverage#903
MridulTailor wants to merge 3 commits intonodejs:mainfrom
MridulTailor:feat/setup-code-coverage

Conversation

@MridulTailor
Copy link
Copy Markdown

Closes #789

Summary

Sets up code coverage reporting using @vitest/coverage-istanbul.

@vitest/coverage-v8 was attempted first but is incompatible with the Cloudflare Workers Vitest pool, it depends on node:inspector which is unavailable in that runtime. Istanbul is the supported alternative per the Cloudflare docs.

Changes

  • package.json: adds test:coverage script
  • vitest.config.ts: enables Istanbul coverage with text/lcov reporters and modest line/function thresholds
  • .github/workflows/test.yml: CI now runs test:coverage
  • .gitignore: adds coverage/ to prevent generated artifacts from being committed
  • package-lock.json: updated for @vitest/coverage-istanbul@3.2.4

Signed-off-by: Mridul Tailor <mtailor729@gmail.com>
@MridulTailor MridulTailor requested a review from a team as a code owner April 9, 2026 02:18
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 9, 2026

PR Summary

Low Risk
Low risk: this is limited to test/CI configuration and devDependencies, with no production runtime behavior changes. Main risk is CI failures if coverage thresholds or include/exclude patterns don’t match current test suite.

Overview
Adds code coverage reporting for Vitest using @vitest/coverage-istanbul, including a new test:coverage script and coverage configuration (reporters, include/exclude, and 80% line/function thresholds) in vitest.config.ts.

Updates CI (.github/workflows/test.yml) to run test:coverage instead of test, and ignores generated coverage/ artifacts via .gitignore; lockfile is updated accordingly.

Reviewed by Cursor Bugbot for commit 4234e42. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment on lines -46 to -47
- name: Run Tests
run: node --run test
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should upload to codecov, no?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sure, I can add that. Just want to check, does the repo already have Codecov enabled on the org side?

Co-authored-by: Matt Cowley <me@mattcowley.co.uk>
Signed-off-by: Mridul Tailor <71081929+MridulTailor@users.noreply.github.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d48f408. Configure here.

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.

Setup Code Coverage

3 participants