Package-level declarations

Types

Link copied to clipboard
class Address(val hostname: String, val port: Int)
Link copied to clipboard
class CloseFrame(val code: Int?, val reason: String?) : WebSocketMessage
Link copied to clipboard
Link copied to clipboard
class KtorTcpServer(port: Int = 0, acceptDelayMillis: Int = 0, dispatcher: CoroutineDispatcher = Dispatchers.IO)
Link copied to clipboard
class MockRequest(val method: String, val path: String, val version: String, val headers: Map<String, String> = emptyMap(), val body: ByteString = ByteString.EMPTY) : MockRequestBase
Link copied to clipboard
interface MockRequestBase
Link copied to clipboard
Link copied to clipboard
interface MockServer : Closeable

A server for testing Kotlin Multiplatform applications using HTTP and WebSockets.

Link copied to clipboard
Link copied to clipboard
interface MultipartBody
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface TcpServer : Closeable

A server that handles TcpSocket is not thread safe and its method must be called from the same coroutine.

Link copied to clipboard
interface TcpSocket : Closeable
Link copied to clipboard
Link copied to clipboard
interface WebSocketBody
Link copied to clipboard
sealed interface WebSocketMessage
Link copied to clipboard
class WebsocketMockRequest(val method: String, val path: String, val version: String, val headers: Map<String, String> = emptyMap()) : MockRequestBase

Properties

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
suspend fun MockServer.awaitRequest(timeout: Duration = 30.seconds): MockRequest
Link copied to clipboard
Link copied to clipboard
fun MockServer.enqueue(string: String = "", delayMs: Long = 0, statusCode: Int = 200)
Link copied to clipboard
fun MockServer.enqueueError(statusCode: Int)
Link copied to clipboard
fun MockServer.enqueueGraphQLString(string: String, delayMs: Long = 0)
Link copied to clipboard
fun MockServer.enqueueMultipart(partsContentType: String, headers: Map<String, String> = emptyMap(), boundary: String = "-"): MultipartBody
Link copied to clipboard
fun MockServer.enqueueString(string: String = "", delayMs: Long = 0, statusCode: Int = 200, contentType: String = "text/plain")
Link copied to clipboard
fun MultipartBody.enqueueStrings(parts: List<String>, responseDelayMillis: Long = 0, chunksDelayMillis: Long = 0)
Link copied to clipboard
fun MockServer.enqueueWebSocket(statusCode: Int = 101, headers: Map<String, String> = emptyMap(), keepAlive: Boolean = true): WebSocketBody
Link copied to clipboard

Retrieves the value of the given key, using a case-insensitive matching

Link copied to clipboard
Link copied to clipboard
expect fun TcpServer(port: Int): TcpServer
actual fun TcpServer(port: Int): TcpServer
actual fun TcpServer(port: Int): TcpServer
actual fun TcpServer(port: Int): TcpServer