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>
This commit is contained in:
Kacper
2025-12-20 23:12:45 +01:00
parent 9b798732b2
commit 8cccf74ace
5 changed files with 81 additions and 6 deletions

View File

@@ -17,12 +17,12 @@ export default defineConfig({
"src/routes/**", // Routes are better tested with integration tests
],
thresholds: {
// Thresholds lowered after moving lib files to shared packages
// TODO: Gradually increase as we add more tests
lines: 55,
functions: 50,
branches: 50,
statements: 55,
// 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"],

View File

@@ -0,0 +1,21 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
globals: true,
environment: "node",
include: ["tests/**/*.test.ts"],
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
include: ["src/**/*.ts"],
exclude: ["src/**/*.d.ts", "src/index.ts"],
thresholds: {
lines: 90,
functions: 100,
branches: 85,
statements: 90,
},
},
},
});

View File

@@ -0,0 +1,21 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
globals: true,
environment: "node",
include: ["tests/**/*.test.ts"],
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
include: ["src/**/*.ts"],
exclude: ["src/**/*.d.ts", "src/index.ts", "src/types.ts"],
thresholds: {
lines: 65,
functions: 75,
branches: 35,
statements: 65,
},
},
},
});

View File

@@ -8,6 +8,16 @@ export default defineConfig({
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
include: ["src/**/*.ts"],
exclude: ["src/**/*.d.ts", "src/index.ts"],
thresholds: {
// Current overall coverage: ~64% (only subprocess.ts well tested)
// Set realistic thresholds until more files are tested
lines: 60,
functions: 40,
branches: 60,
statements: 60,
},
},
},
});

View File

@@ -0,0 +1,23 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
globals: true,
environment: "node",
include: ["tests/**/*.test.ts"],
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
include: ["src/**/*.ts"],
exclude: ["src/**/*.d.ts", "src/index.ts"],
thresholds: {
// Current overall coverage: ~19% (only error-handler.ts tested)
// Set modest thresholds until more files are tested
lines: 15,
functions: 15,
branches: 25,
statements: 15,
},
},
},
});