I have the following three tests:
import io.kotest.core.spec.style.BehaviorSpec
import io.kotest.matchers.shouldBe
class Example {
fun blah(number: Int): Int {
if (number == 1) {
throw IllegalArgumentException()
} else {
return number
}
}
}
class ExampleTest : BehaviorSpec({
Given("example") {
val example = Example()
When("calling blah(0)") {
val result = example.blah(0)
Then("it returns 0") {
result shouldBe 0
}
}
When("calling blah(1)") {
val result = example.blah(1)
Then("it returns 1") {
result shouldBe 1
}
}
When("calling blah(2)") {
val result = example.blah(2)
Then("it returns 2") {
result shouldBe 2
}
}
}
})
The middle test throws an exception which is not expected. I would expect to see 3 tests run, 1 of which failed, but what IntelliJ and Kotest plugin show me is that 2 out of 2 tests passed. I can see in the Test Results side panel that something is not right, but it doesn't have any useful information.
If I navigate to the index.html
with tests results, I can see everything correctly. I would like to see the same data in IntelliJ.
index.html
with the test results:
This issue is resolved in 5.1.0
.