[Feature Request] Add support for importing mock-api
Opened this issue · 0 comments
Tell us about your feature request
As a developer building Go applications I'm used to
go test ./...
my code during development. In order to assist with HTTP request testing packages likenet/http/httptest
exist and I'd like to use it to test my implementation against themock-api
.
At the moment the mock-api
is an internal package to this CLI and the CLI needs to be started outside my tests in order to have the tests run against the API. This isn't really practicable for automated testing.
To improve this, within this tool there could be a library module to be imported by other developers providing an http.Handler
(which should have the same API paths as the official API - i.e. /helix/users
) to be used with the httptest.NewServer(handler http.Handler) *httptest.Server
helper. By using this my tests can spin up the mock-api
within themselves and I don't need to take care of managing it myself outside the test run.
Disclaimer
- I agree