test(#121): add @vitest/coverage-v8 with 80% branch coverage gate

Installs @vitest/coverage-v8 and configures coverage measurement over
src/lib/utils/** and src/lib/server/** — the utility and server-side
logic that is meaningful to measure in the Node test project.

Svelte component files and generated code (api/**, paraglide/**) are
excluded; those run in the browser project.

Baseline: 87.87% branch coverage — already above the 80% threshold.
Adds test:coverage script for local runs; produces lcov report for CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-03-28 16:36:08 +01:00
parent 3983771e79
commit e27af75e21
4 changed files with 198 additions and 0 deletions

View File

@@ -43,6 +43,16 @@ export default defineConfig({
],
test: {
expect: { requireAssertions: true },
coverage: {
provider: 'v8',
reporter: ['text', 'lcov'],
// Measure utility and server-side logic only — Svelte components
// run in the browser project and are excluded here intentionally.
include: ['src/lib/utils/**', 'src/lib/server/**'],
thresholds: {
branches: 80
}
},
projects: [
{
extends: './vite.config.ts',