ScalaTest in sbt: is there a way to run a single test without tags

sbtscalascalatesttesting

I know that a single test can be ran by running, in sbt,

testOnly *class -- -n Tag

Is there a way of telling sbt/scalatest to run a single test without tags? For example:

testOnly *class -- -X 2

it would mean "run the second test in the class. Whatever it is". We have a bunch of tests and no one bothered to tag them, so is there a way to run a single test without it having a tag?

Best Answer

This is now supported (since ScalaTest 2.1.3) within interactive mode:

testOnly *MySuite -- -z foo

to run only the tests whose name includes the substring "foo".

For exact match rather than substring, use -t instead of -z.

Related Topic