-
Notifications
You must be signed in to change notification settings - Fork 47
/
vitest.config.mts
57 lines (53 loc) · 1.34 KB
/
vitest.config.mts
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
import { configDefaults, defineConfig } from "vitest/config";
import type { UserConfig } from "vitest/node";
import path from "node:path";
export default defineConfig({
test: {
environment: "happy-dom",
exclude: [
...configDefaults.exclude,
"helpers",
"bazel-bin",
"bazel-out",
"bazel-player",
"bazel-testlogs",
],
reporters: [
"default",
process.env.XML_OUTPUT_FILE ? "junit" : "basic",
path.join(__dirname, "tools", "vitest_coverage_mapper.ts"),
],
benchmark: {
exclude: [...configDefaults.exclude, "bazel-*/**"],
},
setupFiles: [
path.join(
process.env.XML_OUTPUT_FILE ? "" : __dirname,
"./scripts/vitest.setup.ts",
),
],
outputFile: {
junit: process.env.XML_OUTPUT_FILE ?? "test-results.xml",
},
passWithNoTests: true,
coverage: {
enabled: Boolean(process.env.COVERAGE_OUTPUT_FILE),
reportOnFailure: true,
provider: "v8",
exclude: [
"**/node_modules/**",
"external/**",
"tools/**",
"**/__tests__/**",
"**/__mocks__/**",
"**/*.d.ts",
"**/*.test.*",
"vitest.config.mts",
"postcss.config.js",
"tailwind.config.js",
],
all: true,
reporter: ["text", "html", "lcovonly"],
},
},
}) as UserConfig;