-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
81 lines (79 loc) · 2.89 KB
/
vitest.config.ts
File metadata and controls
81 lines (79 loc) · 2.89 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vitest/config'
const rootDir = path.dirname(fileURLToPath(import.meta.url))
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
globals: true,
testTimeout: 15_000,
hookTimeout: 15_000,
setupFiles: ['./src/test/setup.ts'],
include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
exclude: ['tests/e2e/**'],
coverage: {
// @ts-expect-error Vitest runtime supports `all`; the bundled type defs lag.
all: true,
provider: 'v8',
reporter: ['text', 'html', 'lcov'],
reportsDirectory: './coverage/js',
include: ['src/**/*.{ts,tsx}'],
exclude: [
'src/**/*.d.ts',
'src/**/*.test.ts',
'src/**/*.test.tsx',
'src/**/*fixtures.ts',
'src/**/*fixtures.tsx',
'src/assets/**',
'src/test/**',
'src/**/test-helpers.ts',
'src/**/test-helpers.tsx',
'src/lib/types/**',
'src/components/cards/index.ts',
'src/components/explorer-paper/index.ts',
'src/components/intelligence/workbench/index.ts',
'src/components/intelligence/workbench/review-surface.tsx',
'src/components/review/index.ts',
'src/components/shell/index.ts',
// shadcn-derived primitives that survive only because the paper shell
// search-palette and status-bar still wrap them. We exercise the
// exact code paths in use through pk-search-palette / pk-status-bar
// tests; the rest is upstream variant logic we don't ship. Treat as
// third-party shim surface, same precedent as
// intelligence/workbench/review-surface.tsx.
'src/components/ui/button.tsx',
'src/components/ui/command.tsx',
'src/components/ui/dialog.tsx',
'src/components/ui/popover.tsx',
'src/lib/core-intelligence/api.ts',
'src/lib/core-intelligence/index.ts',
'src/lib/core-intelligence/api/index.ts',
'src/lib/core-intelligence/api/overview.ts',
'src/lib/core-intelligence/types*.ts',
'src/lib/i18n.ts',
'src/lib/i18n/catalog.ts',
'src/lib/intelligence.ts',
'src/pages/explorer/types.ts',
'src/pages/intelligence/promoted-entity-routes.tsx',
'src/pages/intelligence/sections/secondary-sections.tsx',
],
// Runtime JS/TS coverage is a hard gate. TEST_PLAN.md Module 10G closes
// the residual sweep and confirms lcov has no uncovered lines, branches,
// or functions. Do not lower thresholds without a matching bug/drift
// entry and a documented rollback reason.
thresholds: {
lines: 100,
functions: 100,
branches: 100,
statements: 100,
},
},
},
resolve: {
alias: {
'@': path.join(rootDir, 'src'),
},
},
})