没有 ScalaTest 的 akka-testkit

akka-testkit without ScalaTest

我想将 utest 与 akka-testkit 一起使用。 如何在 akka-testkit 中禁用 ScalaTest?

运行 每次执行一个空的 ScalaTest 测试。

[info] ScalaTest
[info] Run completed in 957 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[info] utest
[info] Tests: 1, Passed: 1, Failed: 0
[info] Passed: Total 1, Failed 0, Errors 0, Passed 1

尝试通过从 build.sbt 中的 testFrameworks 设置中过滤掉它来取消注册 ScalaTest,就像这样

testFrameworks := {
  testFrameworks.value.filterNot(_.toString.contains("scalatest"))
}

现在show testFrameworks给出

show testFrameworks
[info] * TestFramework(org.scalacheck.ScalaCheckFramework)
[info] * TestFramework(org.specs2.runner.Specs2Framework, org.specs2.runner.SpecsFramework)
[info] * TestFramework(org.specs.runner.SpecsFramework)
[info] * TestFramework(com.novocode.junit.JUnitFramework)
[info] * TestFramework(utest.runner.Framework)

我们看到的 TestFramework(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework) 不存在。