kotest-core / io.kotest.core.listeners / TestListener / finalizeSpec

finalizeSpec

open suspend fun finalizeSpec(kclass: KClass<out Spec>, results: Map<TestCase, TestResult>): Unit

Called once per Spec, after all tests have completed for that spec.

Regardless of how many times the spec is instantiated, for example, if InstancePerTest or InstancePerLeaf isolation modes are used, this callback will only be invoked once.

The results parameter contains every TestCase, along with the result of that test, including tests that were ignored (which will have a TestResult that has TestStatus.Ignored).

Parameters

kclass - the Spec class

results - a map of each test case mapped to its result.