Kotest Test Output

This page explains how to output Kotest test results.

Test Output

When running Kotest through Gradle’s JUnit Platform support, if you use nested spec styles, you may see that output and test reports include only leaf test names. This is a limitation of Gradle, which is designed around class.method test frameworks.

Until Gradle improves test integration to allow tests to be nested arbitrarily, Kotest provides a workaround by allowing displayFullTestPath to be specified in project configuration.

When this setting is enabled, the test name becomes a concatenation of the full test path. Therefore, a test like this:

package com.devkuma.kotest.tutorial.output

import io.kotest.core.spec.style.DescribeSpec

class MyTests : DescribeSpec({
    describe("describe 1") {
        it("test 1") { }
        it("test 2") { }
    }
})

is output as follows.

MyTests.describe 1 - test 1
MyTests.describe 1 - test 2

References