-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathvitest.config.ts
More file actions
109 lines (104 loc) · 3.53 KB
/
Copy pathvitest.config.ts
File metadata and controls
109 lines (104 loc) · 3.53 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import { coverageConfigDefaults, defineConfig } from "vitest/config";
// Shared exclusions for all projects
// Ref: https://vitest.dev/config/#exclude
const vitestDefaultExcludes = [
"**/node_modules/**",
"**/dist/**",
"**/cypress/**",
"**/.{idea,git,cache,output,temp}/**",
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*",
];
const longRunningTests = ["tests/integration/tools/atlas/performanceAdvisor.test.ts"];
if (process.env.SKIP_ATLAS_INTEGRATION_TESTS === "true") {
vitestDefaultExcludes.push("**/integration/**/atlas/**");
}
if (process.env.SKIP_ATLAS_LOCAL_TESTS === "true") {
vitestDefaultExcludes.push("**/atlas-local/**");
}
export default defineConfig({
test: {
environment: "node",
testTimeout: 3600000,
hookTimeout: 3600000,
setupFiles: ["./tests/setup.ts"],
coverage: {
// Coverage is disabled on Windows as we only report it from the ubuntu job
enabled: process.platform !== "win32",
exclude: [
// Required: import.meta.glob() in src/ui creates Vite virtual modules (\0 prefixed paths)
// that crash Istanbul reporters. See: https://github.com/vitest-dev/vitest/issues/5101
...coverageConfigDefaults.exclude,
"node_modules",
"tests",
"dist",
"vitest.config.ts",
"vite.ui.config.ts",
"scripts",
"src/ui/lib",
],
reporter: ["lcov"],
},
projects: [
{
extends: true,
test: {
name: "unit-and-integration",
include: ["**/*.test.ts"],
exclude: [
...vitestDefaultExcludes,
"scripts/**",
"tests/accuracy/**",
"tests/browser/**",
...longRunningTests,
],
},
},
{
extends: true,
test: {
name: "accuracy",
include: ["**/accuracy/*.test.ts"],
},
},
{
extends: true,
test: {
name: "eslint-rules",
include: ["eslint-rules/*.test.js"],
},
},
{
extends: true,
test: {
name: "atlas-cleanup",
include: ["scripts/cleanupAtlasTestLeftovers.test.ts"],
},
},
{
extends: true,
test: {
name: "mcpb-build-script",
include: ["scripts/createMcpb.test.ts"],
},
},
{
extends: true,
test: {
name: "long-running-tests",
include: [...longRunningTests],
testTimeout: 7200000, // 2 hours for long-running tests
hookTimeout: 7200000,
},
},
{
extends: true,
test: {
name: "ui-components",
include: ["tests/unit/ui/**/*.test.tsx"],
environment: "happy-dom",
setupFiles: ["./tests/setup.ts", "./tests/setupReact.ts"],
},
},
],
},
});