-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathvitest.config.ts
More file actions
94 lines (89 loc) · 3.03 KB
/
vitest.config.ts
File metadata and controls
94 lines (89 loc) · 3.03 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 { 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: {
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/**", ...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: "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"],
},
},
],
},
});