-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
58 lines (57 loc) · 1.91 KB
/
vite.config.ts
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
import { fileURLToPath, URL } from 'node:url'
import { externalizeDepsPlugin } from 'electron-vite'
import tsconfigPaths from 'vite-tsconfig-paths'
import { coverageConfigDefaults, defineConfig } from 'vitest/config'
export default defineConfig({
plugins: [
externalizeDepsPlugin(),
tsconfigPaths({
projects: [fileURLToPath(new URL('./tsconfig.base.json', import.meta.url))],
loose: true
})
],
esbuild: {
target: ['node20']
},
test: {
restoreMocks: true,
unstubEnvs: true,
unstubGlobals: true,
coverage: {
reportOnFailure: true,
exclude: [
// Ignore the output directories.
'dist/**',
'out/**',
// No real tests can be run on the main process start-up.
'src/main/index.ts',
'src/main/main.ts',
// No real tests can be run on the preload process.
'src/preload/index.ts',
// No real tests can be run on the render process start-up.
'src/renderer/index.ts',
'src/renderer/main.ts',
// Not going to automatically test tRPC code, since it is a copy of the WebSocket server.
'src/core/rpc/ipc.ts',
'src/main/routes/**/*.ts',
'src/main/routes/**/*.ts',
'src/main/services/rpc/**/*.ts',
// Not going to test the core URL module till it's used.
'src/core/url.ts',
// Not going to test or cover the UI right now.
// TODO: There are some parts that do need coverage:
// - Import and export.
'src/renderer/services/**/*.ts',
'src/renderer/**/*.ts',
'src/renderer/**/*.tsx',
'src/renderer/**/*.vue',
// No real need to test the support and seeding framework.
'src/tests/support/**/*.ts',
'src/tests/seeds/**/*.ts',
// The configurations don't need any testing or coverage.
'electron.vite.config.ts',
...coverageConfigDefaults.exclude
]
}
}
})