Skip to content

Instantly share code, notes, and snippets.

@SoyRol4ndo
Forked from Klerith/testing-configuration.md
Created December 16, 2025 19:55
Show Gist options
  • Select an option

  • Save SoyRol4ndo/39c4ad2089241eb9ef96055f4ce18376 to your computer and use it in GitHub Desktop.

Select an option

Save SoyRol4ndo/39c4ad2089241eb9ef96055f4ce18376 to your computer and use it in GitHub Desktop.
Configuración de Vitest + React Testing Library

Instalar dependencias Testing

  1. Vitest
npm install --save-dev vitest jsdom
  1. React Testing Library
npm install --save-dev @testing-library/react @testing-library/dom
  • Todo en un sólo comando
npm install --save-dev @testing-library/react @testing-library/dom vitest jsdom
  1. Crear estos scripts en el package.json
"scripts": {
  "test": "vitest",
  "test:ui": "vitest --ui",
  "coverage": "vitest run --coverage"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment