diff --git a/AGENTS.md b/AGENTS.md index 8696debfe..b28e306fc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -343,6 +343,8 @@ deps = [ ### Testing +- **Generated dependency mocks** — Use generated mocks for dependency interfaces; reuse existing mocks or generate missing ones. Do not hand-write interface stubs or function adapters. Stateful in-memory backends may be used or implemented when a test needs their behavior. + - **Unit test package naming** — unit tests must use the same package name as the code under test (not a `*_test` package) so tests can access implementation details when needed. - **Table-driven tests** — prefer table-driven tests with `t.Run` subtests over individual test functions. - **Avoid asserting on error messages** — assert on error type or check the error with `require.Error`, do not `assert.Contains(t, err.Error(), message)`