scala - 如何使用 Mill 运行 JUnit 测试
问题描述
我有一些想要运行的 JUnit 测试。
我sbt
所要做的就是添加这个依赖:
"com.novocode" % "junit-interface" % "0.11" % "test"
根据Mill 文档,您必须添加自定义框架,例如:
def testFrameworks = Seq("org.scalatest.tools.Framework", "WHAT GOES HERE?")
我需要做什么才能让我的 JUnit 测试正常工作?
解决方案
在写这个问题时,我想通了:
在build.sh
你有:
- 要添加此测试依赖项:
ivy"com.novocode:junit-interface:0.11"
- 添加这个测试框架:
com.novocode.junit.JUnitFramework
然后整个组件看起来:
object myModule extends ScalaModule {
def scalaVersion = "2.12.8"
object test extends Tests {
override def ivyDeps = Agg(
ivy"org.scalatest::scalatest:3.0.5",
ivy"com.novocode:junit-interface:0.11"
)
def testFrameworks = Seq("org.scalatest.tools.Framework",
"com.novocode.junit.JUnitFramework")
}
}
推荐阅读
- class - 如何不将空参数从子类传递给 Dart 中的超类?
- amazon-web-services - AWS - 寻找一种方法来定位陈旧/未使用的 IAM 账户以清理 100 多个 AWS 账户
- monaco-editor - 将 html 属性添加到生成的 span(使用 mkt.. 类)
- modelica - 定义饱和温度?P 和质量函数中的其他属性?
- sql-server - SSIS 包部署失败
- opencv - 带有变音符号的路径时QImage无效
- node.js - Passport Github 登录 MERN 应用程序(在 Redux 中管理 Auth)
- python - 我怎么能安装健身房。在 Anaconda 上(Mac OS)
- symfony - Symfony 5 Mailer 使用 liipimagine_filter 嵌入图像
- database - 存储和读取大量位置数据的最佳数据库类型