How do I run a scala ScalaTest in IntelliJ idea?

This worked for me: Edit configurations -> Test kind: All in package


I've been running it like this (however I do find it a little verbose and it can probably be cut down):

@RunWith(classOf[JUnitSuiteRunner])
class AuthorisationParserRunAsTest extends JUnit4(AuthorisationParserSpec)
object AuthorisationParserSpec extends Specification {
  ...
}

If IntelliJ does not pick up the tests automatically, you can do the following:

In the Run Configuration, create a ScalaTest run configuration and set up its "Test kind" to "All in package" and its "Test Package" to the package that contains your tests.


ScalaTest has an Overview over all possibilities; I just annotated all test classes with

@RunWith(classOf[JUnitRunner])