Skip to content

Commit 43916b8

Browse files
committed
test(anthropic-client): replace runTest with runBlocking in test
Use runBlocking instead of runTest for `should return nothing stream data when not json response` to avoid coroutine test scope issues.
1 parent ac37a78 commit 43916b8

File tree

1 file changed

+2
-1
lines changed
  • anthropic-client/anthropic-client-core/src/jvmTest/kotlin/com/tddworks/anthropic/api/messages/api/internal

1 file changed

+2
-1
lines changed

anthropic-client/anthropic-client-core/src/jvmTest/kotlin/com/tddworks/anthropic/api/messages/api/internal/DefaultMessagesApiTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import app.cash.turbine.test
44
import com.tddworks.anthropic.api.messages.api.*
55
import com.tddworks.anthropic.api.mockHttpClient
66
import com.tddworks.common.network.api.ktor.internal.DefaultHttpRequester
7+
import kotlinx.coroutines.runBlocking
78
import kotlinx.coroutines.test.runTest
89
import kotlinx.serialization.json.Json
910
import org.junit.jupiter.api.Assertions.assertEquals
@@ -37,7 +38,7 @@ class DefaultMessagesApiTest : KoinTest {
3738
}
3839

3940
@Test
40-
fun `should return nothing stream data when not json response`() = runTest {
41+
fun `should return nothing stream data when not json response`() = runBlocking {
4142
// Given
4243
val chatsApi =
4344
DefaultMessagesApi(

0 commit comments

Comments
 (0)