setup-frontend-testing
Installation
SKILL.md
Setup Frontend Testing (Unit/Integration)
Procedure
1. Install Dependencies
Install the required dev-dependencies ensuring compatibility with React 18+ and Vite.
npm install -D vitest jsdom @testing-library/react @testing-library/user-event @testing-library/jest-dom @vitest/coverage-v8 msw
2. Configure Vitest (vitest.config.ts)
Create or update the config to use jsdom and set coverage thresholds:
- Globals:
true - Environment:
jsdom - Setup Files:
src/test/setup.ts - Coverage:
- Lines: 85%
- Branches: 75%