
iosTest.dev.gitlive.firebase.firestore.firestore.kt Maven / Gradle / Ivy
/*
* Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license.
*/
package dev.gitlive.firebase.firestore
import kotlinx.coroutines.*
import platform.Foundation.*
actual val emulatorHost: String = "localhost"
actual val context: Any = Unit
actual fun runTest(test: suspend CoroutineScope.() -> Unit) = runBlocking {
val testRun = MainScope().async { test() }
while (testRun.isActive) {
NSRunLoop.mainRunLoop.runMode(
NSDefaultRunLoopMode,
beforeDate = NSDate.create(timeInterval = 1.0, sinceDate = NSDate())
)
yield()
}
testRun.await()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy