diff --git a/firebase-app/src/jsTest/kotlin/dev/gitlive/firebase/firebase.kt b/firebase-app/src/jsTest/kotlin/dev/gitlive/firebase/firebase.kt index 750935cd1..243b3e8cc 100644 --- a/firebase-app/src/jsTest/kotlin/dev/gitlive/firebase/firebase.kt +++ b/firebase-app/src/jsTest/kotlin/dev/gitlive/firebase/firebase.kt @@ -5,11 +5,12 @@ package dev.gitlive.firebase import kotlinx.coroutines.test.runTest +import kotlin.time.Duration.Companion.minutes actual val context: Any = Unit actual fun runTest(test: suspend () -> Unit) { - runTest { test() } + runTest(timeout = 5.minutes) { test() } } @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) actual annotation class IgnoreForAndroidUnitTest diff --git a/firebase-auth/karma.config.d/karma.conf.js b/firebase-auth/karma.config.d/karma.conf.js index a1c2ee21c..88b35fa20 100644 --- a/firebase-auth/karma.config.d/karma.conf.js +++ b/firebase-auth/karma.config.d/karma.conf.js @@ -2,7 +2,7 @@ config.set({ client: { mocha: { - timeout: 10000 + timeout: 180000 } }, }); diff --git a/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt b/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt index 6ac36023f..6a5057f49 100644 --- a/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt +++ b/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt @@ -4,11 +4,14 @@ package dev.gitlive.firebase.auth +import kotlin.time.Duration.Companion.minutes + actual val emulatorHost: String = "localhost" actual val context: Any = Unit -actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() } +actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest(timeout = 5.minutes) { test() } + @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) actual annotation class IgnoreForAndroidUnitTest diff --git a/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt b/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt index 1f1a68395..31ed60491 100644 --- a/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt +++ b/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt @@ -1,8 +1,11 @@ package dev.gitlive.firebase.remoteconfig +import kotlin.time.Duration.Companion.minutes + actual val context: Any = Unit -actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() } +actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest(timeout = 5.minutes) { test() } + @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) actual annotation class IgnoreForAndroidUnitTest diff --git a/firebase-database/karma.config.d/karma.conf.js b/firebase-database/karma.config.d/karma.conf.js index a1c2ee21c..88b35fa20 100644 --- a/firebase-database/karma.config.d/karma.conf.js +++ b/firebase-database/karma.config.d/karma.conf.js @@ -2,7 +2,7 @@ config.set({ client: { mocha: { - timeout: 10000 + timeout: 180000 } }, }); diff --git a/firebase-database/src/jsTest/kotlin/dev/gitlive/firebase/database/database.kt b/firebase-database/src/jsTest/kotlin/dev/gitlive/firebase/database/database.kt index cba8230cf..aec13e788 100644 --- a/firebase-database/src/jsTest/kotlin/dev/gitlive/firebase/database/database.kt +++ b/firebase-database/src/jsTest/kotlin/dev/gitlive/firebase/database/database.kt @@ -8,12 +8,13 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.first import kotlinx.coroutines.withContext import kotlinx.coroutines.withTimeout +import kotlin.time.Duration.Companion.minutes import kotlin.time.Duration.Companion.seconds actual val emulatorHost: String = "127.0.0.1" // in JS tests connection is refused if we use localhost actual val context: Any = Unit -actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { +actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest(timeout = 5.minutes) { // in JS tests we need to wait for the database to be connected awaitDatabaseConnection() test() diff --git a/firebase-perf/src/jsTest/kotlin/dev/gitlive/firebase/perf/performance.kt b/firebase-perf/src/jsTest/kotlin/dev/gitlive/firebase/perf/performance.kt index f0db3d52e..1712a7beb 100644 --- a/firebase-perf/src/jsTest/kotlin/dev/gitlive/firebase/perf/performance.kt +++ b/firebase-perf/src/jsTest/kotlin/dev/gitlive/firebase/perf/performance.kt @@ -10,12 +10,14 @@ import dev.gitlive.firebase.apps import dev.gitlive.firebase.initialize import kotlinx.coroutines.CoroutineScope import kotlin.test.* +import kotlin.time.Duration.Companion.minutes actual val emulatorHost: String = "localhost" actual val context: Any = Unit -actual fun runTest(test: suspend CoroutineScope.() -> Unit) = kotlinx.coroutines.test.runTest { test() } +actual fun runTest(test: suspend CoroutineScope.() -> Unit) = kotlinx.coroutines.test.runTest(timeout = 5.minutes) { test() } + @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) actual annotation class IgnoreForAndroidUnitTest diff --git a/firebase-storage/src/jsTest/kotlin/dev/gitlive/firebase/storage/storage.kt b/firebase-storage/src/jsTest/kotlin/dev/gitlive/firebase/storage/storage.kt index 62b23aab6..dafd2b588 100644 --- a/firebase-storage/src/jsTest/kotlin/dev/gitlive/firebase/storage/storage.kt +++ b/firebase-storage/src/jsTest/kotlin/dev/gitlive/firebase/storage/storage.kt @@ -5,13 +5,14 @@ package dev.gitlive.firebase.storage import kotlinx.coroutines.CoroutineScope +import kotlin.time.Duration.Companion.minutes actual val emulatorHost: String = "127.0.0.1" actual val context: Any = Unit actual fun runTest(test: suspend CoroutineScope.() -> Unit) { - kotlinx.coroutines.test.runTest { test() } + kotlinx.coroutines.test.runTest(timeout = 5.minutes) { test() } } @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) actual annotation class IgnoreForAndroidUnitTest \ No newline at end of file