Skip to content

Commit

Permalink
Skip HttpCacheTest on browser
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Dec 11, 2024
1 parent 010c574 commit c3cce56
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ktor-client/ktor-client-core/common/test/HttpCacheTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ import io.ktor.http.*
import io.ktor.server.response.*
import io.ktor.server.routing.*
import io.ktor.server.testing.*
import io.ktor.util.*
import io.ktor.utils.io.*
import kotlinx.coroutines.*
import kotlinx.coroutines.test.TestResult
import kotlinx.coroutines.test.runTest
import kotlin.coroutines.EmptyCoroutineContext
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.time.Duration.Companion.milliseconds
Expand Down Expand Up @@ -157,4 +161,12 @@ class HttpCacheTest {
assertEquals("after(before(Hello))", firstResponse)
assertEquals(firstResponse, secondResponse)
}

private fun testApplication(block: suspend ApplicationTestBuilder.() -> Unit): TestResult {
return if (!PlatformUtils.IS_BROWSER) {
testApplication(EmptyCoroutineContext, block)
} else {
runTest { println("Skipping test on browser") }
}
}
}

0 comments on commit c3cce56

Please sign in to comment.