Is it possible to use sbt testOnly with Slick TestKit?

234 views Asked by At

When I execute sbt testOnly *JoinTest* no tests are found and the following output is shown, but com.typesafe.slick.testkit.tests.JoinTest should have been executed:

testOnly *JoinTest*
[info] Compiling 1 Scala source to /ext/git/slick/slick-testkit/target/scala-2.10/test-classes...
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] No tests to run for testkit/test:testOnly
2

There are 2 answers

1
Tim Gautier On BEST ANSWER

You're so close. Try this instead:

testOnly -- *JoinTest*

The -- allows you test send arguments to the test kit. Without that it's expecting a list of JUnit tests. More info here.

0
Ionut On

every time when I had a class called as yours .JoinTest to lunch / run all the tests from it I just wrote:

testOnly *.JoinTest

link from sbt 0.13 with details about this

additional if you want to run a specific test case from that class you can use the following command

testOnly *.JoinTest -- -z "test name you want to run"

to discover other commands that you can use with -- you can take a look at this link