我的测试服可以用jvm很好地执行,但是如果我在sbt中启用scalajs插件并运行sbt test
,则会得到以下输出:
[info] Tests:
[info] - should finishTest1
[info] - should finishTest2
...
[info] - should finishTest100
[info] Run completed in 4 seconds, 580 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.
[success] Total time: 4 s, completed Oct 29, 2019 1:27:24 PM
因此似乎可以执行测试,但是其结果被忽略了吗?我真的不确定应该从哪里开始解决此问题。
测试文件如下:
import org.scalatest._
class Tests extends FlatSpec with Matchers {
it should "finishTest1" in {
assert(... == ...)
}
...
}
此外,尽管sbt test
返回上面的输出,但是通过intellij运行测试会导致java.lang.NoClassDefFoundError: org/scalatest/tools/Runner
!