-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Adds test for http auth middleware #2243
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
Conversation
Umang01-hash
left a comment
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.
Hey @gizmo-rt!
The test you added is only adding a coverage of 30% to the file main.go. The middlewares code are commented somehow and we only have one handler registered. Can you please try and uncomment the code to write test for it along with handler.
|
@Umang01-hash The commented example seems like an alternative method to use the auth middleware. |
|
@gizmo-rt what i meant to say was we should add tests that directly cover the main() function. You don't need to uncomment the alternatives - instead, add a test like this: |
Pull Request Template
Description:
Adds test for http auth middleware example
Breaking Changes (if applicable):
Additional Information:
Checklist:
goimportandgolangci-lint.Thank you for your contribution!