cli / go-gh

A Go module for interacting with gh and the GitHub API from the command line.
https://pkg.go.dev/github.com/cli/go-gh/v2
MIT License
322 stars 45 forks source link

Please provide fake api.GQLClient out of the box #93

Closed discentem closed 1 year ago

discentem commented 1 year ago

It would be awesome to provide a fake out of the box for unit tests.

samcoe commented 1 year ago

@discentem Thanks for writing in with the feature request. Right now, we don't feel that we want to be prescriptive with how people test their gh extensions and providing a fake for the API clients would go against that philosophy. There are a number of different testing solutions out there, for example we use gock in this project but in cli/cli repo we are more partial to using moq, and we think it is best to tailor the testing solution to the individual project.