slack
slack copied to clipboard
Allow mocking requests to GetOAuth* methods
In version v0.4.0 I used to be able to mock requests to GetOAuth* methods by overriding the SLACK_API variable: slack.SLACK_API = "some-test-url"
Now this isn't possible anymore, because these methods build the request with APIURL which is a constant:
// GetOAuthResponseContext retrieves OAuth response with custom context
func GetOAuthResponseContext(...) (resp *OAuthResponse, err error) {
...
if err = postForm(ctx, client, APIURL+"oauth.access", ...); err != nil {
...
}
Please would you consider adding back some support for overriding the url? Alternatively, is there a better way to test this?
Thank you