Hey everyone, just started learning about KotlinTe...
# kotlintest
t
Hey everyone, just started learning about KotlinTest and tried using it on a small personal project, but as soon as I configured my CI on Bitrise and it ran my tests (which are written using BehaviorSpec) I noticed that the JUnit / Gradle test report outputs only the Then sentence as the test name (without the Given / When hierarchy to give context) which makes the Spec pretty much unusable for meaningful reports. Anyone facing this and found a workaround? (I found this StackOverFlow question, but no responses so far: https://stackoverflow.com/questions/56899882/kotlintest-junit-reports-arent-containing-the-behaviorspec-steps).
Just an example of what happens. Test:
Copy code
class KnobTest : BehaviorSpec() {

    init {
        Given("A Knob") {
            var knob: Knob

            When("It has default initialization") {
                knob = Knob(null)

                Then("The default value is 50") {
                    knob.currentValue shouldBeExactly 50.0
                }
            }
         }
     }
}
Report:
Copy code
<testcase time="0.06" name="Then: The default value is 50" classname="...data.model.KnobTest"/>
p
it’s a known issue that occurs in
FunSpec
as well: https://github.com/kotlintest/kotlintest/issues/999
s
The problem is with gradle not kotlintest. There's not a lot we can do.