prepared¶
fun <T> prepared(
context: CoroutineContext = EmptyCoroutineContext,
display: Display = Display.Short,
block: suspend TestDsl.() -> T
): PreparedProvider<T>
Declares a lazily-prepared value which will be constructed by calling block during test execution.
The prepared value returned by this function is automatically named after the variable it is stored in.
For more information, see Prepared.
To start an asynchronous coroutine that will run until the end of the test, see TestDsl.foregroundScope and TestDsl.backgroundScope.
Example¶
Declares a lazily-prepared value called name which will be constructed by calling block during test execution.
For more information, see Prepared.
To start an asynchronous coroutine that will run until the end of the test, see TestDsl.foregroundScope and TestDsl.backgroundScope.