1 year ago

#387255

test-img

wrschneider

IntelliJ not finding individual tests in scalatest FlatSpec

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

scala

intellij-idea

scalatest

0 Answers

Your Answer

Accepted video resources