Skip to content

ci(coverage): add vitest coverage reporting with enforced minimum threshold - #26

Open
comandanto wants to merge 1 commit into
Torrent998:mainfrom
comandanto:ci/vitest-coverage-threshold
Open

comandanto wants to merge 1 commit into
Torrent998:mainfrom
comandanto:ci/vitest-coverage-threshold

Conversation

@comandanto

Copy link
Copy Markdown

What this changes

Closes #17.

  • Adds @vitest/coverage-v8 (v5.0.5) to devDependencies to match vitest.
  • Configures test.coverage in vitest.config.ts targeting src/**/*.ts (excluding src/main.ts entrypoint and declaration files) with minimum thresholds:
    • lines: 95% (baseline: 95.49%)
    • statements: 90% (baseline: 92.91%)
    • functions: 90% (baseline: 93.58%)
    • branches: 85% (baseline: 85.97%)
  • Adds "test:coverage": "vitest run --coverage" script in package.json.
  • Integrates npm run test:coverage into .github/workflows/ci.yml.

Why this belongs in this repository

Ensures that pull requests cannot silently regress coverage on critical execution paths (e.g. policy rules, transaction verification, session authentication), failing CI automatically if measured coverage drops below the enforced thresholds.

Other repo API/ABI impact

None. No runtime dependency or API surface changes.

Tests and evidence

  • Ran npm run test:coverage locally: generated complete coverage report and passed all thresholds (113 tests passing).
  • Ran npm run check and npm run build: both exit 0 cleanly.
  • Verified negative case locally by setting lines: 99: vitest correctly reported threshold failure and exited with code 1 before reverting to 95.

Security/privacy and Stellar impact

None. No secrets, credentials, or Soroban smart contract interactions affected.

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.

ci(coverage): add vitest coverage reporting with an enforced minimum threshold

1 participant