Skip to content

Commit 853499c

Browse files
committed
Enforce minimum 80% test coverage in CI + local pre-push hook
1 parent 77547d6 commit 853499c

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

.husky/pre-push

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
# Enforce minimum coverage locally before pushing.
5+
# This mirrors the CI coverage enforcement and keeps merge-ready branches aligned.
6+
bun run test:coverage

bun.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"test:all": "bun run test:unit && bun run test:runtime",
2121
"guard:model-derived": "bun scripts/guard-model-derived.mjs",
2222
"guard:hotpath-policy": "bun scripts/guard-hotpath-policy.mjs",
23+
"prepare": "husky install",
2324
"benchmark:dummy": "vitest bench --watch=false tests/benchmarks/DummyEmbedderHotpath.bench.ts",
2425
"benchmark:query-latency": "vitest bench --watch=false tests/benchmarks/QueryLatency.bench.ts",
2526
"benchmark:storage-overhead": "vitest bench --watch=false tests/benchmarks/StorageOverhead.bench.ts",
@@ -39,6 +40,7 @@
3940
"electron": "latest",
4041
"eslint": "latest",
4142
"fake-indexeddb": "latest",
43+
"husky": "latest",
4244
"typescript": "latest",
4345
"typescript-eslint": "latest",
4446
"vitest": "latest"

vitest.config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ export default defineConfig({
3333
"node_modules/**",
3434
],
3535
thresholds: {
36-
lines: 90,
37-
functions: 90,
38-
branches: 90,
39-
statements: 90,
36+
// Enforce a minimum test coverage baseline.
37+
// Keep this in sync with CI and local pre-push guard.
38+
lines: 80,
39+
functions: 80,
40+
branches: 80,
41+
statements: 80,
4042
},
4143
},
4244
},

0 commit comments

Comments
 (0)