You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 like net/http/httptest exist and I'd like to use it to test my implementation against the mock-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
The text was updated successfully, but these errors were encountered:
Tell us about your feature request
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 thehttptest.NewServer(handler http.Handler) *httptest.Server
helper. By using this my tests can spin up themock-api
within themselves and I don't need to take care of managing it myself outside the test run.Disclaimer
The text was updated successfully, but these errors were encountered: