DedupeChannel module contains more complex logic than
WildcardChannel. We will leverage both Channel and Elixir testing patterns to develop complete tests for our Channel’s logic. Our tests will use message broadcasting to and from the
DedupeChannel. This is the last technique we’ll cover for writing Channel tests.
join/3 function is straightforward in
DedupeChannel, so we won’t add tests for it. We’ll start with tests to check that our Channel state changes when we broadcast a new number to our Channel. Let’s write a few helper functions that make our tests much easier to write and read.