-
Notifications
You must be signed in to change notification settings - Fork 401
/
Copy pathvitest.config.mjs
61 lines (59 loc) · 2.25 KB
/
vitest.config.mjs
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
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: {
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/karma tests
'**/packages/@lwc/aria-reflection/**',
'**/packages/@lwc/engine-dom/**',
'**/packages/@lwc/engine-core/**',
'**/packages/@lwc/synthetic-shadow/**',
// Ignore test packages
'**/packages/@lwc/integration-karma/**',
'**/packages/@lwc/integration-tests/**',
'**/packages/@lwc/integration-types/**',
'**/packages/@lwc/perf-benchmarks-components/**',
'**/packages/@lwc/perf-benchmarks/**',
'**/playground/**',
// This just re-exports other packages
'**/packages/lwc/**',
],
thresholds: {
// SSR compiler/runtime is relatively newer, so has lower thresholds for now
'**/packages/@lwc/ssr-*/**': {
branches: 90,
functions: 60,
lines: 85,
statements: 85,
},
'!**/packages/@lwc/ssr-*/**': {
branches: 95,
functions: 95,
lines: 95,
statements: 95,
},
},
reporter: [
'clover',
'html',
'json',
'lcov',
'text',
['text', { file: 'coverage.txt' }],
],
},
},
});