runTestUnconfined
A helper function to run a test using the UnconfinedTestDispatcher.
This function simplifies running coroutine tests by providing an UnconfinedTestDispatcher as the context, ensuring that coroutines are executed immediately without any delay.
Example usage:
@Test
fun exampleTest() = runTestUnconfined {
// Given a scenario that requires coroutines
// When executing coroutine-based code
// Then verify the expected outcome
}
Content copied to clipboard
Parameters
testBody
The suspending function containing the test code to be executed.