BotNetwork

Testing ports without network

fake platform ports in unit tests; reserve network for contract suites

Guide1 min readUpdated

Why it matters

Fake platform ports in unit tests; reserve network for contract suites.

Practical steps

  1. Draw the boundary for arch port adapters tests: what belongs in the bot process vs a worker.
  2. Implement fake platform ports in unit tests; reserve network for contract suites behind a narrow interface so platforms can share it.
  3. Make arch port adapters tests idempotent at the message/update id layer.
  4. Add contract tests between the adapter and the core for arch port adapters tests.
  5. Document failure modes and ownership of arch port adapters tests for on-call.

Watch out for

  • Copy-pasting outdated snippets for arch port adapters tests without re-reading current official docs.
  • Shipping arch port adapters tests to production without a staging rehearsal and a documented rollback.

Related comparisons and tools