ScalaTest
ScalaTest, as we mentioned, is famous for multiple styles provided to write specifications. Not just multiple styles, this kit also serves as a testing tool for Scala.js and even Java classes. ScalaTest covers most of the Scala ecosystem and allows you to choose different ways to write specifications based on the behavior of your functionality.
Setting up for testing
To use ScalaTest, let's go through some of the basic steps. We can create a fresh SBT project and add a dependency for ScalaTest via the build.sbt
file or use Lightbend's tech hub to download a simple Scala project. Let's try out the second approach as it'll give us ScalaTest already added as a dependency in our build.sbt
file. Let's follow these steps:
- In your favorite browser, open: https://developer.lightbend.com.
- Click on the
START A PROJECT
button:
- Choose
Scala
from project types:
- You can name the project and click on
CREATE A PROJECT FOR ME!
:
This will download a compressed file for you with the name you specified....