Skip to content

Instantly share code, notes, and snippets.

@angelcgar
Created January 2, 2025 21:29
Show Gist options
  • Save angelcgar/a745c007c9ad4ccfbf49204bb5916cd7 to your computer and use it in GitHub Desktop.
Save angelcgar/a745c007c9ad4ccfbf49204bb5916cd7 to your computer and use it in GitHub Desktop.

Intala las dependencias necesarias

pnpm add -D vitest jsdom

alternativa a jsdom es happy-dom

instala Testing library

pnpm install -D @testing-library/react

crea un archivo de vitest.config.mjs con el siguiente contenido

import { defineConfig, mergeConfig } from "vitest/config";
import viteConfig from "./vite.config";

export default mergeConfig(
  viteConfig,
  defineConfig({
    test: {
      environment: "jsdom",
      globals: true,
    },
  })
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment