-
-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
Peter Araujo edited this page Jul 28, 2024
·
1 revision
The ArticApiClient
takes an HttpClientEngine
.
So you can use Ktor testing library's MockEngine
to perform mock requests.
Example:
val engine = MockEngine { _: HttpRequestData ->
respond(
content = "",
status = HttpStatusCode.OK,
headers = headersOf(
HttpHeaders.ContentType,
"application/json"
)
)
}
val client = ArticApiClient(customEngine = engine)
// Test logic...