-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
40 lines (39 loc) · 1.49 KB
/
Copy pathvitest.config.ts
File metadata and controls
40 lines (39 loc) · 1.49 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
import { defineConfig } from 'vitest/config';
import { resolve } from 'path';
// Vitest config for the pure-logic utils (streamParser, mermaid normalize).
// These modules are framework/DOM-free, so the default node environment is
// enough -- no jsdom/happy-dom dependency to install or maintain. Path alias
// mirrors next.config/tsconfig so `@/` imports resolve the same way as in the
// app (a few utils import via `@/contexts/...`).
export default defineConfig({
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
// The app's postcss.config.mjs uses the Tailwind v4 plugin, which Vite can't
// load outside the Next.js pipeline (it throws "Invalid PostCSS Plugin").
// These tests are pure TS with no CSS, so pin postcss to an empty config --
// this makes Vite skip its postcss.config.* file search entirely instead of
// failing to load the Tailwind plugin.
css: { postcss: { plugins: [] } },
test: {
environment: 'node',
include: ['src/**/*.test.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json-summary', 'lcov'],
include: ['src/utils/**/*.ts', 'src/features/**/*.ts'],
exclude: ['src/**/*.test.ts'],
// Coverage is informational-only during consolidation — the
// gates below match the current real coverage. They will be
// raised once the feature-extraction PRs (UI-001, …) land.
thresholds: {
statements: 1,
branches: 1,
functions: 1,
lines: 1,
},
},
},
});