Vitest is a Vite-native unit testing framework that shares the same configuration and plugin ecosystem. Built for speed with native ESM support, hot module replacement for tests, and parallel execution.
When to use: Unit tests, component tests, integration tests, hook tests, in-source tests. Testing React components with React Testing Library. Testing TanStack Query/Router/Form patterns.
When NOT to use: End-to-end testing (use Playwright), visual regression testing (use Percy/Chromatic), load testing (use k6).
단위, 구성 요소 및 통합 테스트를 위한 Vitest 테스트 프레임워크입니다. 테스트 구조(describe/it/test.each), 예상을 사용한 어설션, 수명 주기 후크, 모의(vi.fn/vi.mock/vi.spyOn), React 테스트 라이브러리 패턴, renderHook를 사용한 후크 테스트, 사용자 이벤트 상호 작용, 비동기 유틸리티, 구성, 작업 공간 설정, 적용 범위, 소스 내 테스트 및 동시 실행과 같은 고급 패턴을 다룹니다. 또한 CLI 명령, 테스트 필터링, 태그, 샤딩, test.extend가 포함된 고정 장치 및 고정 범위 지정에 대해서도 다룹니다. 단위 테스트, 구성 요소 테스트, 통합 테스트를 작성하거나 React 후크를 테스트할 때 사용합니다. 테스트 구성, 모의 모듈, 비동기 동작 테스트, 스냅샷 테스트 또는 테스트 적용 범위 설정에 사용합니다. 출처: oakoss/agent-skills.