-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.ts
More file actions
36 lines (34 loc) · 973 Bytes
/
vitest.config.ts
File metadata and controls
36 lines (34 loc) · 973 Bytes
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
/// <reference types="vitest" />
import { defineConfig } from "vite";
import { loadEnv } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import react from "@vitejs/plugin-react";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
return {
plugins: [
react(),
nodePolyfills({
globals: {
Buffer: true,
global: true,
process: true,
},
}),
],
define: {
__dirname: JSON.stringify("/"),
__filename: JSON.stringify("/"),
global: "globalThis",
"process.env": env,
},
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./src/tests/setup.ts"],
css: false,
pool: "forks",
testTimeout: 30000,
},
};
});