On Becoming like Sea Glass

June is a hard month for me. I have experienced a lot of darkness in my Junes. When I was 15, June marked my first major depressive episode. When I was 18 it marked my first manic episode following…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Wrapping Up

Testing Elixir — by Andrea Leopardi, Jeffrey Matthias (19 / 80)

👈 Isolating Code | TOC | Chapter 2 Integration and End-to-End Tests 👉

After writing our first tests, we dug into how to define the scope of a unit test. We then explored the tools ExUnit provides us to organize our tests, rounding out our exploration with ways to design our code to be more testable: refactoring to pure functions or leveraging dependency injection. The foundation we’ve created — organizing test files, understanding the stages of a test, combining list comprehensions with assertions, and designing our code to be testable — will serve as a starting point for all of the additional concepts in this book.

In the next chapter, we’ll expand the scope of our testing black box through integration testing. You’ll see how most of the patterns can be scaled when testing across large parts of the application.

Footnotes

Copyright © 2021, The Pragmatic Bookshelf.

👈 Isolating Code | TOC | Chapter 2 Integration and End-to-End Tests 👉

Add a comment

Related posts:

Dual Addiction Treatment

Addiction is complicated, which is why, in many cases, you might actually be suffering from a variety of addictions and disorders at once. You might have a mental health disorder that leads to a…

Students Partner with the Homeless in Trenton

A truly fine service-learning project — now in progress — from CWI Summer EAST alum Kimby Heil’s students in Trenton, NJ. Kimy’s students are also currently working on an article for Community Works…

Testing Read

This next test is very simple. First, let’s take a look at the code in our Users module. We used “Read” in the section header to keep it in line with CRUD, but you’ll notice that we prefer to call…