File tree Expand file tree Collapse file tree 8 files changed +16
-8
lines changed
firebase-app/src/jsTest/kotlin/dev/gitlive/firebase
src/jsTest/kotlin/dev/gitlive/firebase/auth
firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig
src/jsTest/kotlin/dev/gitlive/firebase/database
firebase-perf/src/jsTest/kotlin/dev/gitlive/firebase/perf
firebase-storage/src/jsTest/kotlin/dev/gitlive/firebase/storage Expand file tree Collapse file tree 8 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 55package dev.gitlive.firebase
66
77import kotlinx.coroutines.test.runTest
8+ import kotlin.time.Duration.Companion.minutes
89
910actual val context: Any = Unit
1011
1112actual fun runTest (test : suspend () -> Unit ) {
12- runTest { test() }
13+ runTest(timeout = 5 .minutes) { test() }
1314}
1415
1516@Target(AnnotationTarget .CLASS , AnnotationTarget .FUNCTION )
Original file line number Diff line number Diff line change 22config . set ( {
33 client : {
44 mocha : {
5- timeout : 5000
5+ timeout : 180000
66 }
77 } ,
88} ) ;
Original file line number Diff line number Diff line change 44
55package dev.gitlive.firebase.auth
66
7+ import kotlin.time.Duration.Companion.minutes
8+
79
810actual val emulatorHost: String = " localhost"
911
1012actual val context: Any = Unit
1113
12- actual fun runTest (test : suspend () -> Unit ) = kotlinx.coroutines.test.runTest { test() }
14+ actual fun runTest (test : suspend () -> Unit ) = kotlinx.coroutines.test.runTest(timeout = 5 .minutes) { test() }
1315
1416@Target(AnnotationTarget .CLASS , AnnotationTarget .FUNCTION )
1517actual annotation class IgnoreForAndroidUnitTest
Original file line number Diff line number Diff line change 11package dev.gitlive.firebase.remoteconfig
22
3+ import kotlin.time.Duration.Companion.minutes
4+
35
46actual val context: Any = Unit
57
6- actual fun runTest (test : suspend () -> Unit ) = kotlinx.coroutines.test.runTest { test() }
8+ actual fun runTest (test : suspend () -> Unit ) = kotlinx.coroutines.test.runTest(timeout = 5 .minutes) { test() }
79
810@Target(AnnotationTarget .CLASS , AnnotationTarget .FUNCTION )
911actual annotation class IgnoreForAndroidUnitTest
Original file line number Diff line number Diff line change 22config . set ( {
33 client : {
44 mocha : {
5- timeout : 5000
5+ timeout : 180000
66 }
77 } ,
88} ) ;
Original file line number Diff line number Diff line change @@ -8,12 +8,13 @@ import kotlinx.coroutines.Dispatchers
88import kotlinx.coroutines.flow.first
99import kotlinx.coroutines.withContext
1010import kotlinx.coroutines.withTimeout
11+ import kotlin.time.Duration.Companion.minutes
1112import kotlin.time.Duration.Companion.seconds
1213
1314actual val emulatorHost: String = " 127.0.0.1" // in JS tests connection is refused if we use localhost
1415
1516actual val context: Any = Unit
16- actual fun runTest (test : suspend () -> Unit ) = kotlinx.coroutines.test.runTest {
17+ actual fun runTest (test : suspend () -> Unit ) = kotlinx.coroutines.test.runTest(timeout = 5 .minutes) {
1718 // in JS tests we need to wait for the database to be connected
1819 awaitDatabaseConnection()
1920 test()
Original file line number Diff line number Diff line change @@ -10,12 +10,13 @@ import dev.gitlive.firebase.apps
1010import dev.gitlive.firebase.initialize
1111import kotlinx.coroutines.CoroutineScope
1212import kotlin.test.*
13+ import kotlin.time.Duration.Companion.minutes
1314
1415actual val emulatorHost: String = " localhost"
1516
1617actual val context: Any = Unit
1718
18- actual fun runTest (test : suspend CoroutineScope .() -> Unit ) = kotlinx.coroutines.test.runTest { test() }
19+ actual fun runTest (test : suspend CoroutineScope .() -> Unit ) = kotlinx.coroutines.test.runTest(timeout = 5 .minutes) { test() }
1920
2021@Target(AnnotationTarget .CLASS , AnnotationTarget .FUNCTION )
2122actual annotation class IgnoreForAndroidUnitTest
Original file line number Diff line number Diff line change 55package dev.gitlive.firebase.storage
66
77import kotlinx.coroutines.CoroutineScope
8+ import kotlin.time.Duration.Companion.minutes
89
910actual val emulatorHost: String = " 127.0.0.1"
1011
1112actual val context: Any = Unit
1213
1314actual fun runTest (test : suspend CoroutineScope .() -> Unit ) {
14- kotlinx.coroutines.test.runTest { test() }
15+ kotlinx.coroutines.test.runTest(timeout = 5 .minutes) { test() }
1516}
1617
1718@Target(AnnotationTarget .CLASS , AnnotationTarget .FUNCTION )
You can’t perform that action at this time.
0 commit comments