-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathvitest.config.ts
More file actions
66 lines (64 loc) · 2.07 KB
/
Copy pathvitest.config.ts
File metadata and controls
66 lines (64 loc) · 2.07 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
63
64
65
66
import { defineConfig } from "vitest/config";
// CI sets PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 to avoid pulling Chromium on
// every job. Integration tests that fork manual-login-runner / health-check
// (and therefore launch a real Patchright browser) cannot run in that mode
// and must be excluded from the test set entirely; otherwise they fail with
// "browser executable doesn't exist" assertion errors after consuming
// minutes per matrix cell. Skipping in CI is the standard pattern; locally
// the env-var is unset so integration tests run normally.
const skipBrowserBackedTests =
process.env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD === "1";
export default defineConfig({
test: {
include: [
"packages/extension/tests/**/*.test.ts",
"packages/webview/tests/**/*.test.{ts,tsx}",
"packages/mcp-server/test/**/*.test.{js,ts}",
"packages/shared/tests/**/*.test.ts",
],
exclude: [
"**/node_modules/**",
...(skipBrowserBackedTests
? ["packages/mcp-server/test/integration/**"]
: []),
],
environment: "node",
coverage: {
provider: "v8",
reporter: ["text", "html", "json-summary"],
include: [
"packages/extension/src/**/*.ts",
"packages/mcp-server/src/**/*.{js,ts}",
],
exclude: [
"packages/**/*.d.ts",
"packages/**/dist/**",
"packages/**/node_modules/**",
"packages/mcp-server/dev-tools/**",
],
all: true,
// Per-file thresholds — security-critical modules must clear ≥95%.
// Build fails if any listed module drops below its floor.
thresholds: {
"packages/mcp-server/src/redact.js": {
lines: 95,
functions: 95,
branches: 90,
statements: 95,
},
"packages/mcp-server/src/vault.js": {
lines: 95,
functions: 95,
branches: 90,
statements: 95,
},
"packages/mcp-server/src/profiles.js": {
lines: 85,
functions: 85,
branches: 80,
statements: 85,
},
},
},
},
});