-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
32 lines (31 loc) · 931 Bytes
/
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
// https://dev.to/thejaredwilcurt/improving-vitest-performance-42c6#:~:text=Turning%20isolation%20off%20(%20%2D%2Dno,cause%20issues%20in%20watch%20mode.
import path from "node:path";
import react from "@vitejs/plugin-react";
import { configDefaults, defineConfig } from "vitest/config";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
test: {
// Graphql is loaded twice and this seems to fix it
// https://github.com/vitejs/vite/issues/7879
// https://github.com/vitest-dev/vitest/issues/2806#issuecomment-1474468560
server: {
deps: {
inline: [/^(?!.*vitest).*$/],
},
},
exclude: [...configDefaults.exclude, "src/e2e/*"],
watch: false,
globals: true,
environmentMatchGlobs: [
["src/app/**/api/**", "node"],
["src/(app|client)/**", "happy-dom"],
["src/server/**", "node"],
],
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
});