Skip to content

Commit ce5b207

Browse files
committed
fix: corrected build issues
1 parent 29a00e2 commit ce5b207

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/mobile-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
distribution: temurin
4444
java-version: '17'
4545
- uses: gradle/actions/setup-gradle@v4
46-
- run: ./gradlew :shared:testDebugUnitTest :shared:jvmTest --stacktrace
46+
- run: ./gradlew :shared:testDebugUnitTest --stacktrace
4747
- uses: actions/upload-artifact@v4
4848
if: always()
4949
with:

mobile/shared/src/commonTest/kotlin/app/myfaq/shared/api/MyFaqApiTest.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import io.ktor.http.HttpStatusCode
99
import io.ktor.http.headersOf
1010
import io.ktor.serialization.kotlinx.json.json
1111
import io.ktor.utils.io.ByteReadChannel
12+
import kotlinx.coroutines.runBlocking
1213
import kotlinx.coroutines.test.runTest
1314
import kotlinx.serialization.json.Json
1415
import kotlin.test.Test
@@ -55,13 +56,15 @@ class MyFaqApiTest {
5556

5657
@Test
5758
fun `meta loader renders success string`() =
58-
runTest {
59+
runBlocking {
5960
val api = MyFaqApiImpl(client(FULL_FIXTURE), baseUrl = "https://example.test")
6061
val loader = MetaLoader(api, scope = this)
61-
var result: String? = null
62-
loader.load(onSuccess = { result = it }, onError = { result = "err: $it" })
63-
testScheduler.advanceUntilIdle()
64-
assertEquals("MyFAQ.app test instance — phpMyFAQ 4.2.0", result)
62+
val deferred = kotlinx.coroutines.CompletableDeferred<String>()
63+
loader.load(
64+
onSuccess = { deferred.complete(it) },
65+
onError = { deferred.complete("err: $it") },
66+
)
67+
assertEquals("MyFAQ.app test instance — phpMyFAQ 4.2.0", deferred.await())
6568
}
6669

6770
private companion object {

0 commit comments

Comments
 (0)