29 lines
814 B
TypeScript
29 lines
814 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
import react from "@vitejs/plugin-react";
|
|
import path from "path";
|
|
|
|
export default defineConfig({
|
|
// Keep test transform simple; plugin-react SWC already handled in Vite dev build, not needed here
|
|
resolve: {
|
|
alias: {
|
|
react: path.resolve(__dirname, "node_modules/react"),
|
|
"react-dom": path.resolve(__dirname, "node_modules/react-dom"),
|
|
},
|
|
},
|
|
esbuild: {
|
|
jsx: "automatic",
|
|
},
|
|
plugins: [react()],
|
|
test: {
|
|
// Temporário: usar happy-dom para contornar falha de render no jsdom enquanto ambiente React é estabilizado
|
|
environment: "happy-dom",
|
|
globals: true,
|
|
setupFiles: ["./vitest.setup.ts"],
|
|
coverage: {
|
|
provider: "v8",
|
|
reportsDirectory: "./coverage",
|
|
reporter: ["text", "html"],
|
|
},
|
|
},
|
|
});
|