-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Help testing middleware #51
Comments
Let me know if this helps. |
Thanks for the quick response! Something else that doesn't work though is then trying to use |
I think providing a |
Yup that would be perfect! |
Please verify b416efc |
Thank you this helps. One last thing that is still not possible is to specify the response status and size because they are private fields of the Response struct. I'm using these fields in the middleware so being able to set them would help testing. |
Check https://github.com/labstack/echo/blob/master/context_test.go#L26. |
Yup calling |
Great! |
echo currently makes it hard/impossible to initialize a context outside of an actual HTTP request handling (the "response" field is private for example). This makes testing echo middleware tricky as one cannot just mock a context. It would be good if echo exposed a way to create arbitrary contexts. To make things more concrete here is an example of what I'm trying to achieve:
The text was updated successfully, but these errors were encountered: