Files
taskplaner/vite.config.ts
Thomas Richter d647308fe1 chore(09-02): configure coverage thresholds with baseline
- Set global thresholds: statements 10%, branches 5%, functions 20%, lines 8%
- Current coverage: statements ~12%, branches ~7%, functions ~24%, lines ~10%
- Thresholds prevent regression, target is 80% (CI-01 decision)
- Thresholds will be increased incrementally as more tests are added
2026-02-03 23:37:22 +01:00

53 lines
1.3 KiB
TypeScript

import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
import { playwright } from '@vitest/browser-playwright';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [tailwindcss(), sveltekit()],
test: {
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: ['src/**/*.{ts,svelte}'],
exclude: ['src/**/*.test.ts', 'src/**/*.spec.ts'],
// Coverage thresholds - starting baseline, target is 80% (CI-01 decision)
// Current: statements ~12%, branches ~7%, functions ~24%, lines ~10%
// These thresholds prevent regression and will be increased incrementally
thresholds: {
global: {
statements: 10,
branches: 5,
functions: 20,
lines: 8
}
}
},
projects: [
{
extends: true,
test: {
name: 'client',
testTimeout: 5000,
browser: {
enabled: true,
provider: playwright(),
instances: [{ browser: 'chromium' }]
},
include: ['src/**/*.svelte.{test,spec}.{js,ts}'],
setupFiles: ['./vitest-setup-client.ts']
}
},
{
extends: true,
test: {
name: 'server',
environment: 'node',
include: ['src/**/*.{test,spec}.{js,ts}'],
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}']
}
}
]
}
});