zio-http
zio-http copied to clipboard
Create ZIO HTTP TestKit module to help with testing
Is your feature request related to a problem? Please describe.
The current version of ZIO HTTP does not provide a testkit, which means that users are on their own for testing.
Describe the solution you'd like
Providing TestServer
and TestClient
implementations of the zio.http.Server
and zio.http.ZClient
interfaces. These test versions would operate similar to the test implementations of Console
, System
, etc., in ZIO core: they would record interactions, and make those interactions accessible; and they would allow feeding responses, errors, or other issues to test the code in question.
Describe alternatives you've considered
None.
@swoogles Thank you! 🙏
I think it makes sense to have a test client however I am not sure if there is any value in adding a test server.
The server is typically implemented using Http
which is a ZIO function. One can simply call the function and run the http app directly in the test.
Seems to be done now