-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathvitest.config.ts
More file actions
42 lines (41 loc) · 1.32 KB
/
Copy pathvitest.config.ts
File metadata and controls
42 lines (41 loc) · 1.32 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
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
globals: true,
setupFiles: [
'src/testUtils/webStorageShim.ts',
'src/testUtils/setup.ts',
],
include: ['src/**/*.test.{ts,tsx}', 'scripts/**/*.test.ts'],
coverage: {
provider: 'v8',
include: ['src/**/*.{ts,tsx}'],
exclude: ['src/vite-env.d.ts', 'src/testUtils/**', 'src/**/*.test.{ts,tsx}', 'src/types/**'],
thresholds: {
lines: 100,
functions: 100,
branches: 100,
statements: 100,
},
},
alias: {
// Test-only module aliases: replace Tauri/Framer Motion with mocks
// These do NOT affect production code — only tests use this config
'@tauri-apps/api/core': resolve(__dirname, 'src/testUtils/mocks/tauri.ts'),
'@tauri-apps/api/event': resolve(__dirname, 'src/testUtils/mocks/tauri.ts'),
'@tauri-apps/api/window': resolve(
__dirname,
'src/testUtils/mocks/tauri-window.ts',
),
'@tauri-apps/api/dpi': resolve(
__dirname,
'src/testUtils/mocks/tauri-window.ts',
),
'framer-motion': resolve(__dirname, 'src/testUtils/mocks/framer-motion.tsx'),
},
},
});