forked from salesforce/lwc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
73 lines (72 loc) · 2.74 KB
/
vitest.config.mjs
File metadata and controls
73 lines (72 loc) · 2.74 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
import { defineConfig } from 'vitest/config';
// The root vitest.config.mjs should only define workspace-level configuration, such as code coverage
// See: https://github.com/vitest-dev/vitest/discussions/3852
export default defineConfig({
test: {
projects: [
'packages/@lwc/babel-plugin-component',
'packages/@lwc/compiler',
'packages/@lwc/engine-core',
'packages/@lwc/engine-dom',
'packages/@lwc/engine-server',
'packages/@lwc/errors',
'packages/@lwc/features',
'packages/@lwc/module-resolver',
'packages/@lwc/rollup-plugin',
'packages/@lwc/shared',
'packages/@lwc/signals',
'packages/@lwc/ssr-compiler',
'packages/@lwc/ssr-runtime',
'packages/@lwc/style-compiler',
'packages/@lwc/template-compiler',
'packages/@lwc/wire-service',
'packages/lwc',
],
coverage: {
provider: 'v8',
exclude: [
// Ignore test files, config files, scripts, deps, and generated files
'**/*.config.*',
'**/.nx-cache/**',
'**/.rollup.cache/**',
'**/__tests__/**',
'**/dist/**',
'**/node_modules/**',
'**/scripts/**',
'**/vitest.*',
// Ignore browser-only modules which are only lightly tested in unit tests
// These are mostly tested in integration tests
'**/packages/@lwc/aria-reflection/**',
'**/packages/@lwc/engine-dom/**',
'**/packages/@lwc/engine-core/**',
'**/packages/@lwc/synthetic-shadow/**',
// TODO [#5272]: add tests
'**/packages/@lwc/ssr-client-utils/**',
// Ignore test packages
'**/packages/@lwc/integration-wtr/**',
'**/packages/@lwc/integration-wdio/**',
'**/packages/@lwc/integration-types/**',
'**/packages/@lwc/perf-benchmarks-components/**',
'**/packages/@lwc/perf-benchmarks/**',
'**/playground/**',
// This just re-exports other packages
'**/packages/lwc/**',
],
thresholds: {
// TODO [#5564]: Restore to 95 across the board
branches: 90,
functions: 89,
lines: 93,
statements: 90,
},
reporter: [
'clover',
'html',
'json',
'lcov',
'text',
['text', { file: 'coverage.txt' }],
],
},
},
});