Skip to content

Execute with Kotestopensavvy.prepared.runner.kotestpreparedSuite

preparedSuite


fun RootScope.preparedSuite(config: TestConfig = TestConfig.Empty, block: SuiteDsl.() -> Unit)

Executes a Prepared SuiteDsl in a Kotest suite.

Since Kotest cannot represent nested non-suspending test suites, all nested suites are declared at the top-level of the provided RootScope. The name of the suite is appended at the start of the tests, so the suite structure is not lost.

Example

This example uses StringSpec, but tests can be registered using any spec.

class MyTests : StringSpec({
    "A regular Kotest test" {
        // …
    }

    preparedSuite {
        test("A regular Prepared test") {
            // …
        }

        suite("A regular Prepared test suite") {
            // …
        }
    }
})