-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathvitest.config.ts
More file actions
86 lines (77 loc) · 2.51 KB
/
vitest.config.ts
File metadata and controls
86 lines (77 loc) · 2.51 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
83
84
85
86
// Copyright 2024 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import os from 'node:os';
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
coverage: {
exclude: [
'**/*.d.ts',
'**/*.test-d.*',
'**/vitest.config.ts',
'**/rslib.config.ts',
'**/*.bench.js',
'**/*.bench.ts',
'**/dist/**',
'.github/**',
'examples/**',
'packages/**/lib/**',
'packages/**/test/**',
'website/**',
'packages/react/transform/tests/__swc_snapshots__/**',
'**/tests/__swc_snapshots__/**',
'.lintstagedrc.mjs',
'**/eslint.config.js',
'packages/tools/canary-release/**',
'packages/web-platform/web-tests/**',
'packages/web-platform/web-core-wasm-e2e/**',
'packages/webpack/test-tools/**',
'packages/testing-library/test-environment/**',
'packages/react/testing-library/**',
'packages/lynx/benchx_cli/**',
'benchmark/react/**',
],
},
env: {
RSPACK_HOT_TEST: 'true',
DEBUG: 'rspeedy',
UPDATE_SNAPSHOT:
process.argv.includes('-u') || process.argv.includes('--update')
? 'true'
: 'false',
NO_COLOR: '1',
FORCE_COLOR: '0',
NODE_ENV: 'test',
},
pool: 'forks',
poolOptions: {
forks: {
minForks: 1,
maxForks: ((cpuCount) =>
Math.floor(
cpuCount <= 32
? cpuCount / 2
: 16 + (cpuCount - 32) / 6,
))(os.availableParallelism()),
},
},
projects: [
'examples/*/vitest.config.ts',
'packages/react/*/vitest.config.ts',
'packages/react/*/vitest.**.config.ts',
'packages/rspeedy/*/vitest.config.ts',
'packages/testing-library/*/vitest.config.mts',
'packages/testing-library/examples/*/vitest.config.ts',
'!packages/testing-library/examples/react-compiler/vitest.config.ts',
'packages/testing-library/examples/react-compiler/vitest.config.*.ts',
'packages/tailwind-preset/vitest.config.ts',
'packages/tools/*/vitest.config.ts',
'packages/use-sync-external-store/vitest.config.ts',
'packages/web-platform/*/vitest.config.ts',
'packages/webpack/*/vitest.config.ts',
'packages/lynx/gesture-runtime/vitest.config.ts',
'packages/motion/vitest.config.ts',
],
},
});