Skip to content

Make test coverage measurable #176

Description

@sepehr-safari

Good First Issue

Coverage cannot currently be measured, even though the project states a target for
it.

vitest.config.ts configures coverage with provider: 'v8' and reporters, and
CONTRIBUTING.md line 189 states "Coverage target: 70%+ for core package". But
@vitest/coverage-v8 is not a dependency and there is no script to run it, so the
command fails outright:

$ npx vitest run --coverage
MISSING DEPENDENCY  Cannot find dependency '@vitest/coverage-v8'

That means the stated 70% target has never been checked and nobody can tell whether
it is met.

What to do

  1. Add @vitest/coverage-v8 to the root devDependencies. Match the installed
    vitest version, which is 3.2.7, so ^3.2.7.
  2. Add a script to the root package.json:
    "test:coverage": "vitest run --coverage"
  3. Run pnpm test:coverage and confirm it produces a report.
  4. In the pull request description, paste the summary table and say whether the
    core package clears the 70% line. Do not change any thresholds or add
    coverage.thresholds in this pull request; reporting the real number is the
    whole point, and what to do about it is a separate decision.

Files to modify

  • package.json (devDependency and script)
  • pnpm-lock.yaml (pnpm install rewrites this, commit the result)

No changeset: this changes tooling only, and nothing in the published package
changes.

Guidelines

  • Run the full local check from
    Verify Locally
    before pushing.
  • Do not add the coverage run to .github/workflows/ci.yml in this pull request.
    Whether CI should gate on coverage is a separate decision.
  • Branch off current main.

How to claim

Comment "I'd like to work on this" and it will be assigned to you.

Please hold one open claim at a time. Once the pull request for it is merged, say
which issue you want next and it will be assigned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions