-
Notifications
You must be signed in to change notification settings - Fork 138
/
vitest.config.ts
34 lines (33 loc) · 1.03 KB
/
vitest.config.ts
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
import { UserConfig } from "vite";
import { configDefaults, defineConfig } from "vitest/config";
import { aliasConfig } from "./vite.config";
export default defineConfig(
({ mode }: UserConfig): UserConfig => ({
resolve: {
alias: aliasConfig,
},
test: {
environment: "jsdom",
exclude: [
...configDefaults.exclude,
...(mode === "test" ? ["src/frontend/src/test-e2e/**"] : []),
],
include: [
...configDefaults.include,
...(mode === "e2e" ? ["src/frontend/src/test-e2e/**/*.test.ts"] : []),
],
globals: true,
watch: false,
setupFiles: "./src/frontend/test-setup.ts",
poolOptions: {
threads: {
// minThreads defaults to number of CPUs. But we want to run e2e tests
// sequentially, and maxThreads must never be lower than minThreads.
// Therefore, we adjust it here to have the flexibility to set the max
// to one for the e2e tests only.
minThreads: 1,
},
},
},
})
);