Files
automaker/apps/server/vitest.config.ts
Kacper 8cccf74ace test: Add and improve coverage thresholds across packages
Added coverage thresholds to all shared lib packages and increased
server thresholds to ensure better code quality and confidence.

Lib package thresholds:
- dependency-resolver: 90% stmts/lines, 85% branches, 100% funcs
- git-utils: 65% stmts/lines, 35% branches, 75% funcs
- utils: 15% stmts/lines/funcs, 25% branches (only error-handler tested)
- platform: 60% stmts/lines/branches, 40% funcs (only subprocess tested)

Server thresholds increased:
- From: 55% lines, 50% funcs, 50% branches, 55% stmts
- To: 60% lines, 75% funcs, 55% branches, 60% stmts
- Current actual: 64% lines, 78% funcs, 56% branches, 64% stmts

All tests passing with new thresholds. Lower thresholds on utils and
platform reflect that only some files have tests currently. These will
be increased as more tests are added.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 23:12:45 +01:00

47 lines
1.6 KiB
TypeScript

import { defineConfig } from "vitest/config";
import path from "path";
export default defineConfig({
test: {
reporters: ['verbose'],
globals: true,
environment: "node",
setupFiles: ["./tests/setup.ts"],
coverage: {
provider: "v8",
reporter: ["text", "json", "html", "lcov"],
include: ["src/**/*.ts"],
exclude: [
"src/**/*.d.ts",
"src/index.ts",
"src/routes/**", // Routes are better tested with integration tests
],
thresholds: {
// Increased thresholds to ensure better code quality
// Current coverage: 64% stmts, 56% branches, 78% funcs, 64% lines
lines: 60,
functions: 75,
branches: 55,
statements: 60,
},
},
include: ["tests/**/*.test.ts", "tests/**/*.spec.ts"],
exclude: ["**/node_modules/**", "**/dist/**"],
mockReset: true,
restoreMocks: true,
clearMocks: true,
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
// Resolve shared packages to source files for proper mocking in tests
"@automaker/utils": path.resolve(__dirname, "../../libs/utils/src/index.ts"),
"@automaker/platform": path.resolve(__dirname, "../../libs/platform/src/index.ts"),
"@automaker/types": path.resolve(__dirname, "../../libs/types/src/index.ts"),
"@automaker/model-resolver": path.resolve(__dirname, "../../libs/model-resolver/src/index.ts"),
"@automaker/dependency-resolver": path.resolve(__dirname, "../../libs/dependency-resolver/src/index.ts"),
"@automaker/git-utils": path.resolve(__dirname, "../../libs/git-utils/src/index.ts"),
},
},
});