kotest-core / io.kotest.core.spec / IsolationMode / InstancePerTest

InstancePerTest

InstancePerTest

A new instance of the Spec class is instantiated for every TestCase - both containers and leaf tests - and they are executed once the previous test has completed.

For example, in the following test plan:

"this test" { println("a") "nested test" { println("b") } "nested test 2" { println("c") } }

The output will be: a a b a c