Package-level declarations

Types

Link copied to clipboard
class MainDispatcherFixture(val dispatcher: TestDispatcher = StandardTestDispatcher())

Replaces Dispatchers.Main with dispatcher between install and reset, from shared code.

Functions

Link copied to clipboard
fun runTestWithMain(dispatcher: TestDispatcher = StandardTestDispatcher(), timeout: Duration? = null, testBody: suspend TestScope.() -> Unit): TestResult

Runs testBody like runTest with dispatcher installed as Dispatchers.Main, and restores the platform's main dispatcher afterward, including when the body fails.