Introduction
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:
- Smart Assertions— This is a unified syntax for asserting both ordinary values and ZIO effects using
assertTrue
method. - Classic Assertions— This one is the classic old-fashioned way of asserting ordinary values (
assert
) and ZIO effects (assertZIO
).