-
Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathvitest.config.ts
38 lines (37 loc) · 1.23 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
35
36
37
38
import { UserConfig } from "vite";
import { configDefaults, defineConfig } from "vitest/config";
import { aliasConfig } from "./vite.config";
import { sveltekit } from "@sveltejs/kit/vite";
export default defineConfig(
({ mode }: UserConfig): UserConfig => ({
resolve: {
alias: aliasConfig,
},
plugins: [sveltekit()],
test: {
environment: "jsdom",
exclude: [
...configDefaults.exclude,
...(mode === "test" ? ["src/frontend/tests/e2e/**"] : []),
],
include: [
...configDefaults.include,
...(mode === "e2e" ? ["src/frontend/tests/e2e/**/*.test.ts"] : []),
],
globals: true,
watch: false,
setupFiles: "./src/frontend/tests/e2e-setup.ts",
// Make sure that our browser e2e tests run one by one:
// - `sequence.concurrent: false` within each test file
// - `fileParallelism: false` across test files
//
// This makes sure that WebdriverIO won't start more than one browser
// instance at the same time, which would result in the following error:
// `Could not start browser after 5 retries: Error: spawn ETXTBSY`
sequence: {
concurrent: false,
},
fileParallelism: false,
},
}),
);