Scala Language Testing with ScalaTest Hello World Spec Test


Create a testing class in the src/test/scala directory, in a file named HelloWorldSpec.scala. Put this inside the file:

import org.scalatest.{FlatSpec, Matchers}

class HelloWorldSpec extends FlatSpec with Matchers {

  "Hello World" should "not be an empty String" in {
      val helloWorld = "Hello World"
      helloWorld should not be ("")