tRPC Testing - Test tRPC routers, middleware, subscriptions, and clients
Provides patterns for unit, integration, API, and end-to-end testing of tRPC routers, procedures, middleware, subscriptions, and React client integrations.
Tags
Updated: 2026-11-30Capabilities
Typical Inputs
Typical Outputs
What this skill does
- Test procedures with callers
- Test middleware in isolation
- Test HTTP integrations
- Test WebSocket subscriptions
- Test React hooks with providers
- Mock application context
- Verify validation and errors
Inputs
- tRPC application code
- Router and procedure definitions
- Middleware definitions
- Application context
- Test users and fixtures
- Database mock
- WebSocket transport
Outputs
- Unit test files
- Integration test files
- End-to-end test files
- Test helpers
- Test results
- Assertion failures
Requirements
- TypeScript environment
- tRPC application
- Vitest, Jest, or Playwright
- React Query for React hook tests
- WebSocket transport for subscription tests
