Trying to debug a test inside of a `ShouldSpec` `s...
# kotest
j
Trying to debug a test inside of a
ShouldSpec
should
block. Test looks something like this:
Copy code
class MyTest : ShouldSpec({
  val foo = "bar"

  should("do something") {
     true shouldBe true // place breakpoint here
  }
})
If I run the test using the Kotest plugin in debug mode and place a breakpoint at the
true shouldBe true
line I don’t see the
foo
variable captured in the “Variables” window like I would expect. I recall being able to debug this relatively recently so I think this is a new issue. Kotlin version — 1.5.30 IntelliJ version — IntelliJ IDEA 2021.2.2 (Ultimate Edition) Build #IU-212.5284.40 Kotest version — 4.6.1 Kotest plugin version — 1.1.36-IC-2021.1 * Not a contribution *
to perhaps make this a bit more concrete here are some screenshots * not a contribution *
o
Isn't that something related to the debugger rather than to Kotest?
j
Certainly could be!
s
Sometimes you can work around by assigning the var to a val before the line where you debug