Loading...
Loading...
Set up Vitest testing environment for Next.js projects
npx skill4agent add tenkoh/skills nextjs-vitestnpm install -D vitest @vitejs/plugin-react jsdom @testing-library/react @testing-library/dom vite-tsconfig-paths @testing-library/jest-dom @testing-library/user-eventvitest.config.mtsimport react from "@vitejs/plugin-react";
import tsconfigPaths from "vite-tsconfig-paths";
import { defineConfig } from "vitest/config";
export default defineConfig({
plugins: [tsconfigPaths(), react()],
test: {
environment: "jsdom",
globals: true,
clearMocks: true,
setupFiles: ["./vitest.setup.ts"],
},
});vitest.setup.tsimport "@testing-library/jest-dom/vitest";