I know that sbt clean coverage test
will generate coverage report using all test cases on the project, this takes ages to finish even with the warm JVM.
I wish to run coverage on the tests for the code I wrote so, I tried to run a single testcase like sbt coverage test-only package.ScalaSpec
and I get the following error.
ERROR
[scala-project] $ coverage test-only package.ScalaSpec
<set>:1: error: eof expected but 'package' found.
coverageEnabled in ThisBuild := true test-only package.ScalaSpec
^
[error] Error parsing expression.
Surround your fully-qualified package name in quotes.
coverage is failing because it is parsing the command as though the test
goal is the first argument to coverage, and the qualified package name package.ScalaSpec
as the second.
What you want to do instead is give coverage only one argument like this:sbt coverage "test-only package.ScalaSpec"
Before, coverage is given the command test
as its goal, followed by an unexpected 2nd parameter.
After, coverage is given the command test-only package.ScalaSpec
as its goal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With