testing-guide
Installation
SKILL.md
Seagull Testing Guide
Quick start (default approach)
When implementing a feature that touches backend/frontend:
-
Classify behavior:
- service semantics (pure rules): put tests near the service
- cross-layer behavior (tRPC + react-query + cache invalidation + timers): use
packages/test-integration - deployment-shape behavior (real Postgres + pooling + true concurrency): run strict smoke tests pre-release
-
Prefer real integrations over hook mocks:
- Do not mock
useMutationwhen the goal is react-query/tRPC integration. - Only mock/alias platform-only deps (Expo/RN modules that break node/jsdom).
- Do not mock
-
Use header-injected identity for multi-user tests:
- Client: set
httpBatchLink({ headers: () => ({ 'x-test-user-id': userId }) }) - Server: in
createContext({ headers }), readheaders.get('x-test-user-id')
- Client: set