abstract class TestContext : CoroutineScope
A TestContext is used as the receiver of a closure that is associated with a TestCase.
This allows the scope body to interact with the test engine, for instance, adding metadata during a test, inspecting the current TestCaseConfig, or notifying the runtime of a nested test.
The test context extends CoroutineScope giving the ability for any test closure to launch coroutines directly, without requiring them to create a scope.
<init> |
A TestContext is used as the receiver of a closure that is associated with a TestCase. TestContext() |
testCase |
The currently executing TestCase. abstract val testCase: TestCase |
invoke |
infix operator fun String.invoke(ignored: suspend TestContext.() -> Unit): Unit |
registerTestCase |
Creates a NestedTest and then registers with the TestContext. suspend fun registerTestCase(name: String, test: suspend TestContext.() -> Unit, config: TestCaseConfig, type: TestType): Unit
Notifies the test runner about a test in a nested scope. abstract suspend fun registerTestCase(nested: NestedTest): Unit |