【问题标题】:Detailed test reports in SBT using ScalaTest使用 ScalaTest 在 SBT 中的详细测试报告
【发布时间】:2011-08-01 13:04:10
【问题描述】:

如何让 SBT 生成更详细的测试输出?现在我唯一得到的是方法和堆栈跟踪的名称 - 我希望对其进行更多控制,以摆脱堆栈跟踪,并可能具有格式化的信息,例如预期的,实际的......

感谢您的帮助

【问题讨论】:

    标签: scala sbt scalatest


    【解决方案1】:

    通常你应该得到一些输出。举个例子:

    class ATest extends FlatSpec with ShouldMatchers {
      "Some Object" should "do something and will fail" in {
        1 should be(2)
      }
    }
    

    将返回:

    [info] Some Object 
    [info] - should do something and will fail *** FAILED *** (QuaternionSpec.scala:17)
    [info]   org.scalatest.TestFailedException: 1 was not equal to 2
    

    你能展示你的测试代码吗?

    要关闭堆栈跟踪,您可以使用:

    trace off
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-12
      • 1970-01-01
      • 1970-01-01
      • 2013-09-14
      • 1970-01-01
      • 2011-11-30
      • 2012-05-05
      • 2014-07-26
      相关资源
      最近更新 更多