Skip to main content
Version: 2.0.x


Assertions are used to make sure that the assumptions on computations are exactly what we expect them to be. They are executable checks for a property that must be true in our code. Also, they can be seen as a specification of a program and facilitate understanding of programs.

We have two types of methods for writing test assertions:

  1. Smart Assertions— This is a unified syntax for asserting both ordinary values and ZIO effects using assertTrue method.
  2. Classic Assertions— This one is the classic old-fashioned way of asserting ordinary values (assert) and ZIO effects (assertZIO).