how to make scalatest generate html report through sbt

后端 未结 2 1681
天涯浪人
天涯浪人 2021-02-08 20:54

The way to do this for specs2 based test in sbt is

(testOptions in Test) += Tests.Argument(TestFrameworks.Specs2, \"html\")

but how about scala

2条回答
  •  爱一瞬间的悲伤
    2021-02-08 21:59

    so two things I need to do...

    I. use any scalatest artifact after 2.0.M5b. For me, I added this dependency,

    org.scalatest" %% "scalatest" % "2.0.M6" % "test->*" excludeAll ( ExclusionRule(organization="org.junit", name="junit") )

    "test->*" is necessary, otherwise dependencies needed to generate the html wont be downloaded. (There must be a better way than this)

    II. In build.sbt, add

    (testOptions in Test) += Tests.Argument(TestFrameworks.ScalaTest, "-u", "target/report")

提交回复
热议问题