-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvitest.config.js
47 lines (46 loc) · 1.16 KB
/
vitest.config.js
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
// vitest.config.ts
import replace from "@rollup/plugin-replace";
import react from "@vitejs/plugin-react";
import path from "path";
import { defineConfig } from "vitest/config";
export default defineConfig({
plugins: [
react(),
replace({
preventAssignment: true,
"process.browser": true,
}),
],
resolve: {
alias: {
// eslint-disable-next-line no-undef
app: path.resolve(__dirname, "./src/app"),
crypto: "crypto-browserify", // Resolve `crypto` to `crypto-browserify`
stream: "stream-browserify",
},
},
test: {
environment: "jsdom",
globals: true,
setupFiles: "./src/setupTests.ts",
exclude: ["node_modules", "dist"],
include: [
"src/**/*.test.{ts,tsx,js,jsx}",
"test/unit/**/*.test.{ts,tsx,js,jsx}",
],
// coverage: {
// provider: "istanbul",
// reporter: ["text", "lcov"],
// reportsDirectory: "./coverage",
// include: ["src/**/*.{js,ts,jsx,tsx}", "test/unit/**/*.{js,ts,jsx,tsx}"],
// },
},
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: "globalThis",
},
},
},
});