Files
orca/docs/reference/test-antipatterns.md
T
Neil ceb2a6c6d9 docs: add test anti-pattern reference (#31277)
* docs: add test anti-pattern reference

* docs: note real-time test waits

* docs: qualify redundant test guidance

* docs: fix agent guide formatting
2026-10-20 17:32:06 -07:00

1.7 KiB

  • Tests that reimplement production logic instead of importing and exercising the real code.
  • Tests with descriptive names but no meaningful assertions, including expect(true).toBe(true).
  • Tests that only assert a mock was called, or assert the exact hardcoded value returned by their own mock.
  • Tests that mock internal database, ORM, builder, or service chains so wrong tables, fields, joins, filters, or arguments cannot fail.
  • Tests whose fixtures, field names, thresholds, or expected statuses encode behavior different from real producers or the source contract.
  • Tests whose names promise inputs or behavior that their setup never exercises.
  • Tests that duplicate stronger coverage and add no unique coverage, faster feedback, or better failure diagnosis.
  • Tests that copy inventories, manifests, export lists, source imports, or literal strings instead of proving behavior.
  • Tests of private predicates, call shapes, or provider-local replays that duplicate shared helper coverage.
  • Test-only exports, globals, wrappers, or production paths that exist solely to make tests possible.
  • Mocks that implement the behavior being asserted or pretend distinct APIs are equivalent.
  • Fixtures that provide receipts, admission, callback ordering, or other outputs the owning production code should generate.
  • Persistence tests that assert against a store path the exercised code never writes.
  • Tests that assert capability flags instead of actual delivery or acknowledgement.
  • Negative controls that pass because an unrelated guard fires or the rejection path is unreachable.
  • Tests that sleep or wait on real time, retries, polling, or networks instead of using fake clocks and deterministic boundaries.