- Notifications
You must be signed in to change notification settings - Fork899
assert request params and body in pull_request_test#95
New issue
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR improves test coverage for pull request operations by asserting that the request parameters and request body payloads are correctly handled.
- Updates the HTTP client mock to use handler functions that verify query parameters and request bodies.
- Adds assertions for various endpoints such as listing, merging, updating branches, and creating reviews/PRs.
Comments suppressed due to low confidence (2)
pkg/github/pullrequests_test.go:700
- [nitpick] The test for updating the pull request branch using an empty request body may benefit from an explanatory comment clarifying why an empty body is expected.
expectRequestBody(t, map[string]interface{}{}).andThen(
pkg/github/pullrequests_test.go:1109
- [nitpick] Consider verifying that the explicit use of float64 for the 'position' field is intentional; if the expected type is an integer, using an int literal (with a conversion if necessary) could improve clarity.
"position": float64(10),
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab.Learn more
ca1a8f9
intomainUh oh!
There was an error while loading.Please reload this page.
Context
Follow-up PR to#94 to continue improving our test coverage. These changes assert that the request parameters and body are correctly handled in the
pull_request_test
file.