Search⌘ K
AI Features

Error Cases

Explore how to write and organize unit tests for error cases in Elixir applications using ExUnit. Learn to test for malformed data inputs like missing keys, understand the importance of clear test naming, and verify your tests to ensure robustness in error handling.

We'll cover the following...

Testing error cases

Every test we’ve written until now has been focused on success cases. Now let’s look at the places where our test case might not pass due to incorrect input data. Since we want to test different functionality in separate tests, let’s choose the malformed ...