-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathvitest.config.ts
More file actions
executable file
·99 lines (95 loc) · 2.54 KB
/
Copy pathvitest.config.ts
File metadata and controls
executable file
·99 lines (95 loc) · 2.54 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import { resolve } from 'node:path';
import { defineConfig } from 'vitest/config';
import electronViteConfig from './electron.vite.config';
const mainConfig = (electronViteConfig as any).main;
const rendererConfig = (electronViteConfig as any).renderer;
export default defineConfig({
test: {
projects: [
// main
{
extends: true,
plugins: mainConfig.plugins,
resolve: {
alias: mainConfig.resolve.alias,
},
test: {
name: 'main',
environment: 'node',
setupFiles: ['tests/main.setup.ts'],
include: ['src/main/**/*.{test,spec}.{ts,tsx}', 'src/main/**/__tests__/**/*.{test,spec}.{ts,tsx}'],
},
},
// renderer
{
extends: true,
plugins: rendererConfig.plugins,
resolve: {
alias: rendererConfig.resolve.alias,
},
test: {
name: 'renderer',
environment: 'jsdom',
setupFiles: ['@vitest/web-worker', 'tests/renderer.setup.ts'],
include: ['src/renderer/**/*.{test,spec}.{ts,tsx}', 'src/renderer/**/__tests__/**/*.{test,spec}.{ts,tsx}'],
},
},
// shared
{
extends: true,
resolve: {
alias: {
'@shared': resolve('src/shared'),
},
},
test: {
name: 'shared',
environment: 'node',
include: ['src/shared/**/*.{test,spec}.{ts,tsx}', 'src/shared/**/__tests__/**/*.{test,spec}.{ts,tsx}'],
},
},
// script
{
extends: true,
test: {
name: 'scripts',
environment: 'node',
include: ['scripts/**/*.{test,spec}.{ts,tsx}', 'scripts/**/__tests__/**/*.{test,spec}.{ts,tsx}'],
},
},
],
// global
globals: true,
setupFiles: [],
exclude: ['**/node_modules/**', '**/dist/**', '**/out/**', '**/build/**'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov', 'text-summary'],
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/out/**',
'**/build/**',
'**/coverage/**',
'**/tests/**',
'**/.yarn/**',
'**/.cursor/**',
'**/.vscode/**',
'**/.github/**',
'**/.husky/**',
'**/*.d.ts',
'**/types/**',
'**/__tests__/**',
'**/*.{test,spec}.{ts,tsx}',
'**/*.config.{js,ts}',
],
},
testTimeout: 20000,
pool: 'threads',
poolOptions: {
threads: {
singleThread: false,
},
},
},
});