-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathvitest.config.ts
More file actions
30 lines (29 loc) · 1.09 KB
/
Copy pathvitest.config.ts
File metadata and controls
30 lines (29 loc) · 1.09 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
import { resolve } from 'path'
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@renderer': resolve(__dirname, 'src/renderer/src'),
'@locales': resolve(__dirname, 'locales')
}
},
test: {
environment: 'happy-dom',
// Run `afterEach` hooks in registration order rather than vitest's default
// reverse ('stack'). The suite-wide unmount in `vitest.setup.ts` registers
// first, so under 'stack' it would run LAST - after each file's own
// teardown had deleted `window.api`, restored mocks or reset the DOM,
// leaving unmount hooks to run against a dismantled environment.
sequence: { hooks: 'list' },
include: ['src/**/*.test.ts'],
exclude: ['src/**/*.integration.test.ts', 'node_modules'],
globals: true,
maxWorkers: 8,
// Installs the shared vue-i18n plugin into @vue/test-utils'
// global mount config so components that call `useI18n()` work
// out of the box in every test file.
setupFiles: ['./vitest.setup.ts']
}
})