Testing Pure Functions
Understand how to effectively test pure functions in Elixir applications using ExUnit. Explore techniques to prepare input data, verify outputs with assertions, and handle testing without side effects or teardown.
We'll cover the following...
We'll cover the following...
Pure functions
A function is pure if every single time you call the function with the same parameters, it returns the same answer, and if it has no side effects. If a dependency can change the result, the function is not pure.
When testing a pure function, the test ...