-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
62 lines (60 loc) · 1.88 KB
/
Copy pathvitest.config.ts
File metadata and controls
62 lines (60 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { availableParallelism } from "node:os";
import { resolve } from "node:path";
import { defineConfig } from "vitest/config";
const maxWorkers = Math.max(1, Math.min(8, availableParallelism() - 1));
export default defineConfig({
test: {
environment: "node",
maxWorkers,
include: [
"src/**/*.test.ts",
"src/**/*.test.tsx",
"scripts/**/*.test.ts",
],
// DB tests require bun:sqlite — run with `bun run test:db` instead
exclude: ["src/**/*.bun.test.ts", "scripts/**/*.bun.test.ts"],
coverage: {
provider: "v8",
processingConcurrency: Math.min(4, maxWorkers),
// The merge step creates the final text summary, JSON summary, and HTML report.
reporter: ["json"],
reportsDirectory: "coverage/vitest",
include: ["src/**/*.{ts,tsx}", "src/server/ptyInputParser.cjs"],
exclude: [
"src/**/*.test.{ts,tsx}",
"src/**/*.bun.test.ts",
// Test-only helpers and vitest __mocks__ modules.
"src/test/**",
"src/**/__mocks__/**",
"src/**/*.test-utils.ts",
// Covered by the separate Bun test runner, which supports bun:sqlite.
"src/db/**",
// These modules now use Bun-native APIs and are covered in the Bun lane.
"src/lib/frontmatter.ts",
"src/lib/updates.ts",
"src/lib/vault.ts",
"src/server/skillImports.ts",
"src/server/skillInstalls.ts",
"src/server/skillPackage.ts",
// Generated or embedded artifacts are not authored coverage targets.
"src/routeTree.gen.ts",
"src/server/codexProtocol/**",
"src/server/embedded-client.ts",
],
// Initial floor measured 2026-07-10: S 43.30, B 36.53, F 35.26, L 44.40.
// Keep a small cross-platform margin and ratchet these values upward.
thresholds: {
statements: 42,
branches: 35,
functions: 34,
lines: 43,
},
},
},
resolve: {
alias: {
"#": resolve(import.meta.dirname, "src"),
"@": resolve(import.meta.dirname, "src"),
},
},
});