We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code does not work as expected when the first attempt does not succeed:
Eventually(func(ctx SpecContext) (*http.Response, error) { req, err := http.NewRequestWithContext(ctx, http.MethodPost, "http://localhost:8080/test", strings.NewReader(query)) req.Header.Add("Content-Type", "application/json") if err != nil { return nil, err } return http.DefaultClient.Do(req) }). WithContext(ctx). WithPolling(5 * time.Second). WithTimeout(30 * time.Second). Should(HaveHTTPBody(MatchJSON(expectedResult)))
This appears to be caused by the use of a cached variable that is never updated after being set: https://github.com/onsi/gomega/blob/master/matchers/have_http_body_matcher.go#L76
The text was updated successfully, but these errors were encountered:
Possible solution: Store the pointer for the response and use that to determine if the cache should be used or not.
Sorry, something went wrong.
hey @Kyle-Cooley - good catch; agreed on checking the pointer as you're proposing. Would you be up for submitting a PR?
Hello @onsi , yes, I will make a PR for it.
Successfully merging a pull request may close this issue.
The following code does not work as expected when the first attempt does not succeed:
This appears to be caused by the use of a cached variable that is never updated after being set:
https://github.com/onsi/gomega/blob/master/matchers/have_http_body_matcher.go#L76
The text was updated successfully, but these errors were encountered: