-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
46 lines (45 loc) · 1.39 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
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 ouput directories.
'dist/**',
'out/**',
// No real unit tests can be run on the main process start-up.
'src/main/index.ts',
'src/main/main.ts',
// No real unit tests can be run on the render process start-up.
'src/renderer/index.ts',
'src/renderer/main.ts',
// Not going to test or cover the UI right now.
'src/renderer/helpers/attachment.ts',
'src/renderer/helpers/element.ts',
'src/renderer/modals/dialogs.ts',
'src/renderer/plugins/router.ts',
'src/renderer/plugins/vuetify.ts',
'src/renderer/**/*.vue',
// The configurations don't need any testing or converage.
'electron.vite.config.ts',
...coverageConfigDefaults.exclude
]
}
}
})