-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathvitest.config.ts
More file actions
94 lines (90 loc) · 2.48 KB
/
Copy pathvitest.config.ts
File metadata and controls
94 lines (90 loc) · 2.48 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
87
88
89
90
91
92
93
94
import { defineConfig } from 'vitest/config';
/**
* Shared test settings inherited by every project. Coverage lives at the
* top-level config because it cannot be set per-project in projects mode.
*/
const sharedTestConfig = {
testTimeout: 15_000,
env: {
HYBRIDCLAW_DISABLE_CONFIG_WATCHER: '1',
},
};
const sharedExclude = ['node_modules/**', 'dist/**', 'container/**'];
// The installer Docker matrix (scripts/install.sh) lives in its own project so a
// plain `vitest run --project e2e` — invoked by several CI jobs — never pulls it
// in. It is gated only on a reachable Docker daemon (no opt-in env var); run it
// explicitly with `--project install-e2e` (see the test:install-e2e script).
// Note the `-e2e` suffix does NOT match the `.e2e.test.ts` glob, so it must be
// excluded from the broad `unit` include explicitly.
const installE2eGlob = 'tests/**/*.install-e2e.test.ts';
export default defineConfig({
test: {
coverage: {
provider: 'v8',
reporter: ['text', 'json-summary'],
include: ['src/**/*.ts'],
exclude: [
'container/**',
'src/cli.ts',
'src/onboarding.ts',
'src/tui.ts',
'src/update.ts',
],
thresholds: {
lines: 28,
functions: 30,
branches: 21,
},
},
projects: [
{
test: {
...sharedTestConfig,
name: 'unit',
include: ['tests/**/*.test.ts'],
exclude: [
'tests/**/*.integration.test.ts',
'tests/**/*.e2e.test.ts',
installE2eGlob,
'tests/**/*.live.test.ts',
...sharedExclude,
],
},
},
{
test: {
...sharedTestConfig,
name: 'integration',
include: ['tests/**/*.integration.test.ts'],
exclude: sharedExclude,
},
},
{
test: {
...sharedTestConfig,
name: 'e2e',
include: ['tests/**/*.e2e.test.ts'],
exclude: [installE2eGlob, ...sharedExclude],
globalSetup: ['tests/helpers/e2e-global-setup.ts'],
},
},
{
test: {
...sharedTestConfig,
name: 'install-e2e',
include: [installE2eGlob],
exclude: sharedExclude,
},
},
{
test: {
...sharedTestConfig,
name: 'live',
include: ['tests/**/*.live.test.ts'],
exclude: sharedExclude,
maxWorkers: 1,
},
},
],
},
});