/// import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; export default defineConfig({ plugins: [react()], test: { globals: true, environment: "jsdom", setupFiles: ["./tests/setup.ts"], include: ["tests/**/*.{test,spec}.{ts,tsx}"], exclude: ["tests/e2e/**", "**/node_modules/**"], coverage: { provider: "v8", reporter: ["text", "json", "html"], include: ["src/**/*.{ts,tsx}"], exclude: ["src/main.tsx", "src/**/*.d.ts"], }, // Mock Tauri APIs (including subpath exports) alias: { "@tauri-apps/api/core": path.resolve(__dirname, "./tests/mocks/tauri-api.ts"), "@tauri-apps/api/event": path.resolve(__dirname, "./tests/mocks/tauri-api.ts"), "@tauri-apps/api": path.resolve(__dirname, "./tests/mocks/tauri-api.ts"), "@tauri-apps/plugin-shell": path.resolve( __dirname, "./tests/mocks/tauri-plugin-shell.ts" ), }, }, resolve: { alias: { "@": path.resolve(__dirname, "./src"), }, }, });