forked from vuejs/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
82 lines (80 loc) · 2.1 KB
/
vitest.config.ts
File metadata and controls
82 lines (80 loc) · 2.1 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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { configDefaults, defineConfig } from 'vitest/config'
import { entries } from './scripts/aliases.js'
export default defineConfig({
define: {
__DEV__: true,
__TEST__: true,
__VERSION__: '"test"',
__BROWSER__: false,
__GLOBAL__: false,
__ESM_BUNDLER__: true,
__ESM_BROWSER__: false,
__CJS__: true,
__SSR__: true,
__FEATURE_OPTIONS_API__: true,
__FEATURE_SUSPENSE__: true,
__FEATURE_PROD_DEVTOOLS__: false,
__FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
__COMPAT__: true,
},
resolve: {
alias: entries,
},
test: {
globals: true,
pool: 'threads',
setupFiles: 'scripts/setup-vitest.ts',
sequence: {
hooks: 'list',
},
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
include: ['packages/*/src/**'],
exclude: [
// entries that are not really used during tests
'packages/vue-compat/**',
'packages/vue/src/dev.ts',
'packages/vue/src/runtime.ts',
// not testable during unit tests
'packages/runtime-core/src/profiling.ts',
'packages/runtime-core/src/featureFlags.ts',
'packages/runtime-core/src/customFormatter.ts',
// tested via e2e so no coverage is collected
'packages/runtime-core/src/hydrationStrategies.ts',
'packages/runtime-dom/src/components/Transition*',
],
},
projects: [
{
extends: true,
test: {
name: 'unit',
exclude: [
...configDefaults.exclude,
'**/e2e/**',
'**/{vue,vue-compat,runtime-dom}/**',
],
},
},
{
extends: true,
test: {
name: 'unit-jsdom',
include: ['packages/{vue,vue-compat,runtime-dom}/**/*.{test,spec}.*'],
exclude: [...configDefaults.exclude, '**/e2e/**'],
environment: 'jsdom',
},
},
{
extends: true,
test: {
name: 'e2e',
environment: 'jsdom',
isolate: true,
include: ['packages/vue/__tests__/e2e/*.spec.ts'],
},
},
],
},
})