-
-
Notifications
You must be signed in to change notification settings - Fork 164
/
vitest.config.mts
65 lines (63 loc) · 1.68 KB
/
vitest.config.mts
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
59
60
61
62
63
64
65
/// <reference types="vitest" />
import { defineConfig, coverageConfigDefaults } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
/**
* vitest 配置文件
*
* @see vitest https://cn.vitest.dev
*
* 文件名需要使用 mts 后缀,否则会有警告信息
*
* @see CJS https://cn.vitejs.dev/guide/troubleshooting#vite-cjs-node-api-deprecated
*/
export default defineConfig({
/**
* 配置插件 vue,如果不配置则识别不了 vue 文件
*/
plugins: [
vue({
script: {
defineModel: true
}
})
],
test: {
/**
* 配置环境
*
* @see environment https://cn.vitest.dev/config/#environment
*
* 这里建议使用 jsdom 因为 happy-dom 会有一些不可预期错误,详情参考:
*
* @see test-utils https://github.com/vuejs/test-utils/issues/1704
* @see test-utils https://github.com/vuejs/test-utils/issues/1602
* @see fighting-design https://github.com/FightingDesign/fighting-design/pull/346
*/
environment: 'jsdom',
css: true,
coverage: {
exclude: [
...coverageConfigDefaults.exclude,
'docs/**',
'start/**',
'scripts/**',
'packages/fighting-add-component/**',
'packages/fighting-playground/**',
'packages/fighting-eslint-config/**',
'packages/fighting-icon/**',
]
},
/**
* 排除目录
*
* @see exclude https://cn.vitest.dev/config/#exclude
*/
exclude: ['**/fighting-add-component/**'],
/**
* 包含目录
*
* @see include https://cn.vitest.dev/config/#include
*/
include: ['**/packages/fighting-design/**/__test__/*.{test,spec}.{ts,tsx}']
}
})