What it does
ExUnit is the unit-testing framework shipped with Elixir. Test modules use `ExUnit.Case` to define named tests and assertions, and can include setup callbacks or doctests. Mix, Elixir's project tool, finds files named `*_test.exs` under the project test directory when you run its test task. ExUnit is suited to Elixir projects that want their test runner included with the language toolchain, rather than a separate service or package to manage.
A Mix project starts with a test directory and a test_helper.exs file that calls ExUnit.start(). In a test module, use ExUnit.Case enables named test blocks, and assertions such as assert compare expected and actual results. The Mix task loads the helper and finds files matching test/**/*_test.exs, so a normal project can run its suite with mix test. These are documented examples; no Elixir code or tests were run for this entry.
Choose concurrency deliberately
ExUnit can run test modules concurrently when a case uses async: true, but the documentation advises enabling that only when tests do not modify global state. Tests in the same module normally run serially. This makes it practical to parallelize independent cases while keeping tests that share global resources in a safer arrangement.
ExUnit ships with Elixir, and Mix is part of the same language toolchain. The framework is not a cross-language runner: users need an Elixir project and its dependencies, and the test author supplies the cases and assertions. The Elixir repository licenses its code under Apache License 2.0; this entry covers ExUnit, not Mix as a separate development tool.
Strengths
- Ships with Elixir and works directly with Mix project conventions, without a separate test-service account.
- Provides cases, assertions, callbacks, and doctest support for Elixir applications.
- Allows test modules to run concurrently when they do not share mutable global state.
Watch out for
- ExUnit is specific to Elixir and expects an Elixir project and toolchain.
- Concurrent cases require care: the documentation advises against async execution when tests change global state.
Best for
- Elixir developers adding unit tests to Mix projects
- Teams using doctests and named test cases in Elixir libraries or applications
- Projects that want parallel test modules where shared state is not modified
Sources
- ExUnit — ExUnit v1.20.4 (Oct 25, 2026)
- mix test — Mix v1.20.4 (Oct 25, 2026)
- ExUnit.Case — ExUnit v1.20.4 (Oct 25, 2026)
- Apache License - elixir-lang/elixir (Oct 25, 2026)
