Intellij在Scalatest FlatSpec中未找到单个测试
我正在运行Intellij。我有一个测试套件,该套件扩展了flatspec
由于
class MyTest extends FlatSpec {
val foo = Seq(1, 2, 3)
foo.foreach { x => println(x) }
it should "run test 1" in {
println("foo")
}
it should "run test 2" in {
println("bar")
}
}
某种原因,block foo.foreach {x => println(x)}
阻止Intellij在套件中发现单个测试,例如“运行测试1”。
如果我评论这一行,Intellij会找到各个测试。
这里的根本原因是什么?
Intellij社区版,2021.2.3
I am running IntelliJ. I have a test suite that extends FlatSpec
like
class MyTest extends FlatSpec {
val foo = Seq(1, 2, 3)
foo.foreach { x => println(x) }
it should "run test 1" in {
println("foo")
}
it should "run test 2" in {
println("bar")
}
}
For some reason the line with the block foo.foreach { x => println(x)}
is preventing IntelliJ from discovering the individual tests in the suite like "run test 1".
If I comment this line out, IntelliJ finds the individual tests.
What's the root cause here?
IntelliJ community edition, 2021.2.3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论