Reformat runBlockingTest implementations

This commit is contained in:
Michael Bull 2021-05-05 14:05:18 +01:00
parent eb7d0461d1
commit a5c153477b
2 changed files with 6 additions and 3 deletions

View File

@ -6,5 +6,8 @@ import kotlinx.coroutines.promise
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
actual fun runBlockingTest(context: CoroutineContext, testBody: suspend CoroutineScope.() -> Unit): dynamic = actual fun runBlockingTest(context: CoroutineContext, testBody: suspend CoroutineScope.() -> Unit): dynamic {
GlobalScope.promise(context) { testBody(this) } return GlobalScope.promise(context) {
testBody(this)
}
}

View File

@ -5,7 +5,7 @@ import kotlinx.coroutines.runBlocking
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
actual fun runBlockingTest(context: CoroutineContext, testBody: suspend CoroutineScope.() -> Unit) { actual fun runBlockingTest(context: CoroutineContext, testBody: suspend CoroutineScope.() -> Unit) {
runBlocking { return runBlocking {
testBody(this) testBody(this)
} }
} }