Programming in Scala [Chapter 14]-Assertions and Unit Testing
Briefly

There are two crucial methods for ensuring that the software you develop behaves as intended: using assertions and conducting unit tests.
In Scala, assertions are written using the assert method, which throws an AssertionError if the specified condition is false. There's a two-argument version allowing for an explanation upon failure. Alternatively, the ensuring method in Predef facilitates concise checks on a result type by using a predicate function.
In Scala, there are various options for unit testing, including established Java tools like JUnit and TestNG, as well as Scala-specific tools like ScalaTest, specs, and ScalaCheck. ScalaTest provides flexibility in writing tests, with the simplest approach involving the creation of classes that extend org.scalatest.Suite and defining test methods within them.
Read at Medium
[
add
]
[
|
|
]