Skip to content
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

Update simplified http response assertion #3142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

miledxz
Copy link
Contributor

@miledxz miledxz commented Feb 16, 2025

Proposed changes

Adding simplified http response assertion

Problem: Not using built in Gomega assertions

Solution: Using built in Gomega assertions

Here we explicitly returns nil, making it clear that if framework.Get does not fail, the function should not return an error.
Expect will fail the test if conditions are not met, so returning err does not add value.

Closes #1992

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@miledxz miledxz requested a review from a team as a code owner February 16, 2025 11:00
@github-actions github-actions bot added the tests Pull requests that update tests label Feb 16, 2025
@miledxz miledxz changed the title adding simplified http response assertion Update simplified http response assertion Feb 16, 2025
@sjberman
Copy link
Collaborator

Thanks @miledxz, I think there are a couple other locations in a few tests that can also be updated. If you do a search for http.StatusOK, that should help find them.

@sindhushiv sindhushiv added this to the v2.0.0 milestone Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Pull requests that update tests
Projects
Status: External Pull Requests
Development

Successfully merging this pull request may close these issues.

Simplify HTTP response assertions in tests
3 participants