#Test-Doubles
4 notas · última:
My New Favorite Elixir Testing Trick
Author shows how to replace IO-heavy modules with a fake that sends messages to the test process, allowing ExUnit `assert_receive` assertions similar to Ruby test doubles.
Unit Tests in Elixir - Part 2
Explains how to unit test Elixir functions that talk to other processes by injecting dependencies, and by treating GenServer casts as commands and calls as queries.
Unit testing Angular with Jest
Explains how to set up Jest in an Angular project, write narrow unit tests, and use doubles and Angular’s DI/testing utilities to isolate dependencies and detect bugs early.
You Don't Hate Mocks; You Hate Side-Effects
The article argues that excessive mock expectations are a signal of side-effects in the design. Refactoring away from those side-effects often removes the mock and leads to simpler, more focused tests.
