forked from vexip-ui/vexip-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
31 lines (29 loc) · 936 Bytes
/
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
import { resolve } from 'path'
import { readdirSync, statSync } from 'fs'
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
const dirs = readdirSync(__dirname).filter(f => statSync(resolve(f)).isDirectory())
export default defineConfig({
resolve: {
alias: [
{ find: /^@\/(.+)/, replacement: resolve(__dirname, '$1') },
{ find: '@vexip-ui/config', replacement: resolve(__dirname, 'common/config/src') }
]
},
test: {
include: ['components/*/tests/*.spec.{ts,tsx}'],
environment: 'happy-dom',
clearMocks: true,
setupFiles: [resolve(__dirname, 'scripts/test-setup.ts')],
transformMode: {
web: [/\.[jt]sx$/]
},
coverage: {
exclude: dirs.filter(f => f !== 'components').map(f => `${f}/**`),
reporter: ['text'],
extension: ['ts', 'tsx', 'vue']
}
},
plugins: [vue(), vueJsx()]
})