I am using JGiven for my tests in one of my Play 2.3.x application. The documentation explains how to generate HTML reports for Maven and Gradle. But nothing is available for SBT.
Is there any workaround to generate reports at the end of the tests ? Maybe by adding something in build.sbt
? I tried to play with "javaOptions in Tests" but couldn't figure out how to make it work.
Thanks.
See below my solution using a dedicated SBT task.
jgiven-html5-report
dependency:libraryDependencies += "com.tngtech.jgiven" % "jgiven-html5-report" % "0.15.3" % "test"
livingDocumentation
:lazy val livingDocumentation = taskKey[Unit]("Generate HTML5 JGiven report")
livingDocumentation := Def.sequential(
test in Test,
runMain in Test toTask " com.tngtech.jgiven.report.ReportGenerator"
).value
Using Def.sequential
, I can chain 2 tasks and ensure the source JSON reports are available.
sbt livingDocumentation