-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
53 lines (51 loc) · 1.8 KB
/
Copy pathvitest.config.ts
File metadata and controls
53 lines (51 loc) · 1.8 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
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';
import { createRequire } from 'module';
const _require = createRequire(import.meta.url);
const gitnexusPkg = _require('../gitnexus/package.json');
export default defineConfig({
plugins: [react()],
define: {
__REQUIRED_NODE_VERSION__: JSON.stringify(gitnexusPkg.engines.node.replace(/[>=^~\s]/g, '')),
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@anthropic-ai/sdk/lib/transform-json-schema': path.resolve(
__dirname,
'node_modules/@anthropic-ai/sdk/lib/transform-json-schema.mjs',
),
mermaid: path.resolve(__dirname, 'node_modules/mermaid/dist/mermaid.esm.min.mjs'),
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./test/setup.ts'],
include: ['test/**/*.test.{ts,tsx}', 'src/**/*.test.{ts,tsx}'],
testTimeout: 15000,
coverage: {
provider: 'v8',
include: ['src/**/*.{ts,tsx}'],
exclude: [
'src/workers/**', // Web workers (require worker env)
'src/core/lbug/**', // WASM (requires SharedArrayBuffer)
'src/core/tree-sitter/**', // WASM (requires tree-sitter binaries)
'src/core/embeddings/**', // WASM (requires ML model)
'src/main.tsx', // Entry point
'src/vite-env.d.ts', // Type declarations
],
// Thresholds set to the post-vitest-4 baseline (AST-aware remapping
// measures coverage more accurately than the old istanbul-style mapping,
// so the same 220 tests now report slightly lower percentages). These
// are soft floors for regression detection, not coverage targets.
thresholds: {
statements: 9,
branches: 4,
functions: 7,
lines: 9,
},
},
},
});