A Whirlwind Tour of Testing in Elixir
summary
Shows a concrete testing stack and workflow: ExUnit for fast unit tests (826 tests run in ~6s), a second suite of ~200 service/component tests (~28s), plus Bypass for mock HTTP servers, Mox for behavior-checked mocks, and Pact Elixir for consumer-driven contract tests. Recommends dependency injection and OTP behaviors so mocks cannot drift, wraps third-party libs behind an interface instead of mocking them directly, migrates brittle Cucumber end-to-end suites to service-level tests, and follows the principles damp not dry and don't mock what you don't own.
AI-written summary · about
chapters (23)
- 0:00Testing in Elixir intro
- 1:07Maintainable test suites
- 3:34Testing pyramid & unit tests
- 4:59Unit test rules
- 6:04TDD philosophy
- 8:08Sandi Metz’s matrix
- 9:11Testing incoming queries
- 10:14Testing incoming commands
- 11:37Mocks for outgoing commands
- 13:22Avoid mock divergence with Mox
- 14:48Behaviors for mock safety
- 16:11Testing principles & mocks
- 16:32Don’t mock what you don’t own
- 17:56DAMP over DRY
- 19:19Beyond unit tests
- 20:02Service tests with Bypass
- 22:29Contract tests with Pact
- 25:39End-to-end limits
- 27:43Test suite performance
- 28:46Key takeaways
- 29:28Choosing testing approach
- 29:49Resources & community
- 30:33Q&A








