Closed Noah-Huppert closed 5 years ago
I have 3 choices of how to test this:
net/http/httptest
package to mock GitHub API responses and still use the full go-github client with a custom BaseURL
.I like option 3. However this won't be perfect b/c if a API call works is highly dependent on the parameters passed to the API call. We must make sure we are testing that those parameters are OK.
I think that option 1 provides a solution to the problem with using option 3. If we mock out the behavior of a go-github client for certain method, as in make these methods search some test harness of the GitHub API which emulates a repository.
I am going to write tests for this.