The Play Framework is configured out of the box for specs2. However, some people (including the author) prefer ScalaTest. Play actually doesn’t really care what testing framework you use, but there is one gotcha you need to know about.
The default Play configuration sets the test options
junitxml console, which are specific to specs2. Because ScalaTest
doesn’t understand these options, you need to specify
testOptions in Test := Nil
in your build definition.
Starting with Play 2.2,
build.sbt is used for the build definition.
Simply add the line:
For Play 2.0 or 2.1,
project/Build.scala is used. You’ll have to do
something like the following:
1 2 3 4
Also, don’t forget to add ScalaTest as a project dependency. At the time of writing, the latest version can be specified with the following: