Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

juruen
Copy link
Collaborator

@juruen juruen commented Apr 4, 2025

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.

@Copilot Copilot AI review requested due to automatic review settings April 4, 2025 10:12
Copy link
Contributor

@Copilot Copilot AI left a 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

@juruen juruen merged commit ca1a8f9 into main Apr 4, 2025
16 checks passed
@juruen juruen deleted the juruen/pr-assert branch April 4, 2025 11:57
manian0430 pushed a commit to ChrisLally/github-mcp-server that referenced this pull request Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants