async-component-test
Installation
SKILL.md
Async Component Test
Generates tests for components with async data lifecycle — covering loading, success, error, and retry states without timing hacks or act() warnings.
Phase 1: Discovery
Extract before writing:
- Framework — React? Vue? (this skill defaults to React + Testing Library)
- Data fetching mechanism —
useEffect+fetch, React Query, SWR, Apollo, or server component? - Test runner — Jest + jsdom, or Vitest + jsdom/happy-dom?
- How fetches are intercepted —
jest.mockon a service module,msw(Mock Service Worker), orjest.spyOn(global, 'fetch')? - Does the component have a retry interaction — a button, a link, or auto-retry?
- Suspense boundaries — is the component wrapped in
<Suspense>? (changes how loading state is tested)
Default to msw if no interceptor preference is stated — it's the least brittle option.