generated from nhcarrigan/template
78b951a865
- Add @vitest/coverage-v8 for frontend test coverage - Configure vitest with coverage thresholds (15% statements/lines, 13% branches/functions) - Add npm scripts for backend testing and coverage with cargo-llvm-cov - Add test:all and coverage:all scripts for unified test execution - Exclude coverage directory from git tracking
31 lines
731 B
TypeScript
31 lines
731 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
import { sveltekit } from "@sveltejs/kit/vite";
|
|
|
|
export default defineConfig({
|
|
plugins: [sveltekit()],
|
|
test: {
|
|
include: ["src/**/*.{test,spec}.{js,ts}"],
|
|
environment: "jsdom",
|
|
setupFiles: ["./vitest.setup.ts"],
|
|
globals: true,
|
|
coverage: {
|
|
provider: "v8",
|
|
reporter: ["text", "json", "html"],
|
|
reportsDirectory: "./coverage",
|
|
include: ["src/lib/**/*.ts"],
|
|
exclude: [
|
|
"src/lib/**/*.test.ts",
|
|
"src/lib/**/*.spec.ts",
|
|
"src/lib/**/*.d.ts",
|
|
"src/lib/components/**",
|
|
],
|
|
thresholds: {
|
|
statements: 15,
|
|
branches: 13,
|
|
functions: 13,
|
|
lines: 15,
|
|
},
|
|
},
|
|
},
|
|
});
|