utilitiesKt


public final class utilitiesKt


Summary

Public methods

static final void
@UnstableApi
doBlocking(
    @NonNull CoroutineContext context,
    @NonNull SuspendFunction1<@NonNull CoroutineScopeUnit> block
)

Runs the given block using runBlocking on the current thread for side effect.

Public methods

@UnstableApi
public static final void doBlocking(
    @NonNull CoroutineContext context,
    @NonNull SuspendFunction1<@NonNull CoroutineScopeUnit> block
)

Runs the given block using runBlocking on the current thread for side effect.

Using this function is like runBlocking with default context (which runs the given block on the calling thread) but forces the return type to be Unit, which is helpful when implementing suspending tests as expression functions:

@Test
fun
myTest() = doBlocking {...}