Testing DedupeChannel

Learn about testing the dedupe channel.

We'll cover the following

DedupeChannel

Our 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.

Our 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.

Get hands-on with 1000+ tech skills courses.