kotest-core / io.kotest.core.extensions / SpecExtension / intercept

intercept

abstract suspend fun intercept(spec: KClass<out Spec>, process: suspend () -> Unit): Unit

Intercepts execution of a Spec.

Implementations must invoke the process callback if they wish this spec to be executed. If they want to skip the tests in this spec they can elect not to invoke the callback.

Once the process function returns, the execution of this Spec and all it's nested TestCases are guaranteed to have been completed.

Parameters

process - callback function required to continue spec processing