SpeziTestScope

fun SpeziTestScope(context: CoroutineContext = UnconfinedTestDispatcher()): TestScope

Creates a new instance of TestScope with the provided CoroutineContext.

This function is useful for creating a TestScope with a specific CoroutineContext, defaulting to UnconfinedTestDispatcher if no context is provided.

Return

A new instance of TestScope with the specified CoroutineContext.

Example usage:

val testScope = SpeziTestScope()
testScope.launch {
// Coroutine code to test
}

Parameters

context

The CoroutineContext to be used for the TestScope. Defaults to UnconfinedTestDispatcher.