-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.js
More file actions
48 lines (46 loc) · 1.08 KB
/
Copy pathvitest.config.js
File metadata and controls
48 lines (46 loc) · 1.08 KB
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
48
// vite.config.js
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
import { fileURLToPath } from "url";
// __dirname em ESM
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "src")
}
},
server: {
host: true, // permite acesso via LAN
port: 3000, // ajuste se necessário
strictPort: false,
open: true
},
preview: {
host: true,
port: 3001
},
// Config do Vitest (usa o mesmo arquivo do Vite)
test: {
globals: true,
include: ["**/*.test.{js,jsx,ts,tsx}"],
exclude: [
"test/integration/**",
"test/integraation/**",
"hardhat.config.*",
"scripts/**",
"node_modules/**",
"dist/**"
],
// padrão para React
environment: "jsdom",
// usa 'node' para testes de serviços/backend-like
environmentMatchGlobs: [
["src/services/**", "node"]
],
passWithNoTests: false
}
});