2016-08-18 64 views
4

當我使用SBT我得到的輸出運行下面簡單的測試,我希望:Scalatest套房沒有詳細的測試狀態輸出

​​

輸出:

[info] TestSimple: 
[info] a 
[info] - should do *** FAILED *** 
[info] Array(1, 3) did not equal Array(1, 2) (SimpleTest.scala:5) 
[info] ScalaTest 
[info] Run completed in 980 milliseconds. 
[info] Total number of tests run: 1 
[info] Suites: completed 1, aborted 0 
[info] Tests: succeeded 0, failed 1, canceled 0, ignored 0, pending 0 
[info] *** 1 TEST FAILED *** 
[error] Failed: Total 1, Failed 1, Errors 0, Passed 0 
[error] Failed tests: 
[error]   TestSimple 
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful 

當測試包括在套件中並用DoNotDiscover註釋,如下所示:

import org.scalatest.{DoNotDiscover, FlatSpec, Matchers, Suites} 

class FullTestSuite extends Suites(new TestSimple) 

@DoNotDiscover 
class TestSimple extends FlatSpec with Matchers { 
    "a" should "do" in { 
    Array(1,3) should equal (Array(1,2)) 
    } 
} 

然後輸出不包含每個測試succ ESS和失敗,而是剛剛整體效果:

[info] ScalaTest 
[info] Run completed in 975 milliseconds. 
[info] Total number of tests run: 1 
[info] Suites: completed 2, aborted 0 
[info] Tests: succeeded 0, failed 1, canceled 0, ignored 0, pending 0 
[info] *** 1 TEST FAILED *** 
[error] Failed: Total 1, Failed 1, Errors 0, Passed 0 
[error] Failed tests: 
[error]   FullTestSuite 
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful 

我怎樣才能運行測試一套房實例內輸出何處以及如何失敗?

感謝

回答

3

我猜你正面臨着一個錯誤#916。您還應該嘗試版本>=3.0.0-M15並向開發人員提供您的反饋。