-
-
Save alistairsykes/a6910faf17021a23d77bdccdbf8d7f70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Common | |
@Suppress("UnusedPrivateMember") | |
internal expect fun <T> runTest(block: suspend () -> T) | |
// Android | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.test.runBlockingTest | |
@UseExperimental(ExperimentalCoroutinesApi::class) | |
internal actual fun <T> runTest(block: suspend () -> T) { | |
runBlockingTest { block() } | |
} | |
// iOS | |
import kotlinx.coroutines.runBlocking | |
internal actual fun <T> runTest(block: suspend () -> T) { | |
runBlocking { block() } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment