Skip to content

chore: add a test coverage report - #233

Merged
sadjow merged 3 commits into
mainfrom
chore/coverage-report
Oct 15, 2026
Merged

sadjow merged 3 commits into
mainfrom
chore/coverage-report

Conversation

@sadjow

@sadjow sadjow commented Oct 14, 2026

Copy link
Copy Markdown
Member

pnpm test:coverage runs the Vitest suite with the V8 coverage provider and reports coverage for src/. It prints a per-file table and writes an HTML report to coverage/index.html, which Git, Prettier, and ESLint already ignore.

On main, the suite covers 89.68% of lines in src/:

File Lines Branches
utm.ts 92.85% 100%
parameters.ts 90.9% 60%
plugin.ts 90% 70.14%
options.ts 81.25% 58.33%
composables.ts 0% 100%

The numbers count only code that runs inside the Vitest process: the unit tests, and the module setup that runs while fixtures build. Code the browser integration tests exercise in the page or in the fixture's Nuxt server isn't counted, which is why composables.ts shows 0% even though the integration tests call useNuxtUTM(). CONTRIBUTING explains how to read the report.

@vitest/coverage-v8 must match the installed Vitest version exactly, so a new Dependabot group updates vitest and @vitest/* together instead of in separate PRs that would leave them mismatched. The command is opt-in for now. CI runs pnpm test as before, and no coverage threshold is enforced.

Validation: pnpm test:coverage (128 tests), pnpm format:check, and pnpm lint --max-warnings 0 with a generated coverage/ folder present pass.

@sadjow
sadjow merged commit b35c36f into main Oct 15, 2026
7 checks passed
@sadjow
sadjow deleted the chore/coverage-report branch October 15, 2026 01:51
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