Wrapping Up
Tests are critical for production applications. They give you confidence that your application works as expected and will handle errors correctly. The way that you test doesn’t matter as much as having the tests, so start early!
Elixir provides a built-in testing framework called ExUnit. It’s a great testing library that has an intentionally limited number of features and assertions. Despite being a small library, ExUnit is powerful and expressive—largely due to its support for pattern matching. ExUnit verifies that asserted patterns match correctly. And if a pattern doesn’t match, ExUnit highlights what specifically was different between the left and right sides.
ExUnit tests are specified by using the ExUnit.Case module. This brings ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access