docs(adr): ADR-011 TDD foundation; update AGENTS.md per-feature

Captures the decision to add @repo/core-testing, factories, contract
suites, vitest safety defaults, coverage thresholds, Storybook
test-runner, and CI as one cohesive TDD foundation. Per-feature
AGENTS.md gains a Tests section pointing to factories, contract suite,
and the canonical test commands.

Spec: §7.4, §7.5

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-05 19:31:31 +02:00
parent 17d3488fb4
commit 5ea4c67f93
7 changed files with 141 additions and 2 deletions

View File

@@ -69,6 +69,18 @@ beforeEach(() => {
- **Alias** — `@/` resolves to `src/`
- **Run** — `pnpm test --filter @repo/media`
## Tests
- **Factories:** `src/__factories__/media.factory.ts` — use `mediaFactory.build({ overrides })` to construct test data with stable defaults.
- **Unit tests:** colocated as `*.test.ts` next to the source file.
```bash
pnpm test --filter @repo/media # all tests for this feature
pnpm test --filter @repo/media -- --watch # watch mode
```
See `docs/guides/tdd-workflow.md` for the cycle.
## Structure (minimal)
```