-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvitest.config.ts
More file actions
55 lines (54 loc) · 1.59 KB
/
vitest.config.ts
File metadata and controls
55 lines (54 loc) · 1.59 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
/// <reference types="vitest" />
import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
plugins: [react(), tsconfigPaths()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@core': path.resolve(__dirname, './src/core'),
'@editor': path.resolve(__dirname, './src/editor'),
'@game': path.resolve(__dirname, './src/game'),
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/test/setup.ts'],
css: true,
include: ['src/**/*.{test,spec}.{js,ts,jsx,tsx}'],
exclude: ['node_modules', 'dist', '.git', '.cache'],
// Watch mode configuration (only enabled via --watch flag)
watchExclude: ['**/node_modules/**', '**/dist/**', '**/.git/**'],
// Only rerun tests affected by changes
forceRerunTriggers: ['**/vitest.config.ts', '**/src/test/setup.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'src/test/',
'**/*.d.ts',
'**/*.config.*',
'**/coverage/**',
'**/dist/**',
'**/public/**',
],
},
// Enable UI mode for better debugging (disabled by default, use yarn test:ui to enable)
ui: false,
// Reporter configuration
reporter: ['verbose', 'html'],
// Timeout settings
testTimeout: 30000,
hookTimeout: 30000,
// Mock configuration
server: {
deps: {
inline: ['@testing-library/user-event'],
},
},
},
});