forked from vexip-ui/vexip-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
42 lines (39 loc) · 1.12 KB
/
vitest.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
import { resolve } from 'node:path'
import { readdirSync, statSync } from 'node:fs'
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
const rootDir = __dirname
const dirs = readdirSync(__dirname).filter(f => statSync(resolve(rootDir, f)).isDirectory())
export default defineConfig({
root: rootDir,
resolve: {
alias: [
{ find: /^@\/(.+)/, replacement: resolve(__dirname, '$1') },
{
find: /^@vexip-ui\/(bem-helper|utils|hooks|config)/,
replacement: resolve(__dirname, 'common/$1/src')
}
]
},
optimizeDeps: {
include: ['@vexip-ui/icons']
},
test: {
include: ['components/*/tests/*.spec.{ts,tsx}'],
environment: 'happy-dom',
clearMocks: true,
setupFiles: [resolve(rootDir, 'scripts/test-setup.ts')],
coverage: {
exclude: [
...dirs.filter(f => f !== 'components').map(f => `${f}/**`),
'**/*.style.ts',
'**/*.css.ts'
],
reporter: ['text', 'html'],
extension: ['ts', 'tsx', 'vue']
},
testTimeout: 10000
},
plugins: [vue(), vueJsx()]
})