Write docs/testing.md: the cross-app testing philosophy and the conventions a contributor must follow. The most important rule: tests never start real external services — Redis, Postgres, S3/MinIO are always mocked or replaced with in-process fakes (ioredis-mock, the local-disk object store, mocked db), so pnpm test runs with no Docker.
Acceptance criteria:
- States the no-external-services rule explicitly, with the reasoning and the approved substitutes for each dependency
- Documents the per-app runners and commands (
vitest for backend and web, pytest for the AI agent, cargo test for contracts)
- Explains the established Drizzle mocking pattern used across the backend suite, and why
.values() sometimes has to be both thenable and expose .returning()
- Documents that socket handlers must be exercised via the enveloped
dispatch event, not by grabbing a raw socket.on listener
- Notes the trap that shared in-process rate-limit counters leak between tests unless reset
Write
docs/testing.md: the cross-app testing philosophy and the conventions a contributor must follow. The most important rule: tests never start real external services — Redis, Postgres, S3/MinIO are always mocked or replaced with in-process fakes (ioredis-mock, the local-disk object store, mockeddb), sopnpm testruns with no Docker.Acceptance criteria:
vitestfor backend and web,pytestfor the AI agent,cargo testfor contracts).values()sometimes has to be both thenable and expose.returning()dispatchevent, not by grabbing a rawsocket.onlistener