June 2022
Intermediate to advanced
130 pages
2h 45m
English
Often, new programming languages lack the robust tools that mature languages have. Almost from the beginning, Elixir was created with a full set of tools. This tooling has accelerated Elixir’s adoption. Two of the most critical parts of that infrastructure are tests and tasks.
The Elixir tooling includes a built-in test environment called ExUnit. Believe it or not, you’ve already created your first test. mix new created it for you. Let’s run that test now:
| | [hello] ➔ mix test |
| | Compiling 1 file (.ex) |
| | Generated hello app |
| | .. |
| | |
| | Finished in 0.02 seconds |
| | 1 doctest, 1 test, 0 failures |
We ran our test, and got two dots. Let’s see what’s making all of the noise:
| | defmodule HelloTest do |
| | use ExUnit.Case |
| | doctest Hello |
| | |
| |
Read now
Unlock full access