Summary

In this chapter about testing, we went through a broad range of topics. Let's review the most important ones:

  • Testing in Elixir is powered by the thorough ExUnit framework, which enables us to create descriptive and concise tests that are able to run concurrently.
  • We can create function mocks in Elixir using the Mox library, allowing our tests to still run concurrently. Mocks have to be created based on a behaviour, so that the API of the mock and the real implementation don't diverge.
  • Ecto's modular design allows us to separate changeset tests (which verify our business logic) from repository tests (which verify our queries and the interaction with the database). In either case, we're able to run the tests concurrently.
  • Elixir provides ...

Get Mastering Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.