I just upgraded my sbt project starter to include a basic unit test setup.

The sbt user guide provides the fundamentals of how to setup the these tests. Here are the basic steps:

  1. ensure you have a src/test/scala/ path in the project
  2. update build.sbt to include the test framework dependency
    • note: the test configuration is how to tell sbt to only include the test dependencies on the “test classpath”
  3. add a basic test in the test classpath

commit that shows this work

Now the tests can be run thru IntelliJ by ctrl-clicking the test class name. Or they can be run from the terminal:

sbt clean compile test