feat(test): add Istanbul browser coverage via standalone client config

Vitest 4 silently ignores per-project coverage overrides in test.projects,
so a standalone vitest.client-coverage.config.ts provides the root-level
Istanbul coverage block that Vitest actually honours.

Root vite.config.ts retains the v8 coverage block (reportsDirectory:
coverage/server) for the server project. The client config writes to
coverage/client and instruments all .svelte and .svelte.ts files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-09 17:49:41 +02:00
parent 1a28e3114d
commit bb374bf2cd
2 changed files with 47 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ export default defineConfig({
coverage: {
provider: 'v8',
reporter: ['text', 'lcov'],
reportsDirectory: 'coverage/server',
// Measure utility and server-side logic only. Svelte components run
// in the browser project and are excluded here. Browser-only TS files
// (actions, hooks, domain-specific UI state) are also excluded.