scala tests
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:
- ensure you have a
src/test/scala/
path in the project - 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”
- note: the
- add a basic test in the test classpath
Now the tests can be run thru IntelliJ by ctrl
-clicking the test class name. Or they can be run from the terminal: