File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
src/jsTest/kotlin/dev/gitlive/firebase/database Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -70,15 +70,15 @@ kotlin {
7070 useCommonJs()
7171 nodejs {
7272 testTask {
73- useMocha {
74- timeout = " 5s "
73+ useKarma {
74+ useChromeHeadless()
7575 }
7676 }
7777 }
7878 browser {
7979 testTask {
80- useMocha {
81- timeout = " 5s "
80+ useKarma {
81+ useChromeHeadless()
8282 }
8383 }
8484 }
Original file line number Diff line number Diff line change @@ -10,16 +10,13 @@ import kotlinx.coroutines.withContext
1010import kotlinx.coroutines.withTimeout
1111import kotlin.time.Duration.Companion.seconds
1212
13- actual val emulatorHost: String = " 127.0.0.1" // in JS connection is refused if we use localhost
13+ actual val emulatorHost: String = " 127.0.0.1" // in JS tests connection is refused if we use localhost
1414
1515actual val context: Any = Unit
1616actual fun runTest (test : suspend () -> Unit ) = kotlinx.coroutines.test.runTest {
17- val db = getDatabase()
18- goOnline(db)
17+ // in JS tests we need to wait for the database to be connected
1918 awaitDatabaseConnection()
2019 test()
21- // in JS tests are running infinitely without going database offline
22- goOffline(db)
2320}
2421
2522private suspend fun awaitDatabaseConnection () = withContext(Dispatchers .Default ) {
You can’t perform that action at this time.
0 commit comments