如何通过 sbt 使 scalatest 生成 html 报告

编程入门 行业动态 更新时间:2024-10-19 03:26:39
本文介绍了如何通过 sbt 使 scalatest 生成 html 报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在 sbt 中进行基于 specs2 的测试的方法是

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

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

但是 scalatest 怎么样?我做了很多谷歌搜索,但找不到好的解释/解决方案.

but how about scalatest? I've done lots of Google search, but cannot find a good explanation/solution.

推荐答案

所以我需要做两件事...

so two things I need to do...

我.使用 2.0.M5b 之后的任何 scalatest 工件.对我来说,我添加了这个依赖项,

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->*" 是必需的,否则将不会下载生成 html 所需的依赖项.(一定有比这更好的办法)

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

二.在 build.sbt 中添加

II. In build.sbt, add

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

更多推荐

如何通过 sbt 使 scalatest 生成 html 报告

本文发布于:2023-11-25 15:24:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630284.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报告   sbt   scalatest   html

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!