How to make path params work in unit tests without having to add in request struct? #2714
Unanswered
bhambrah-asbuilt
asked this question in
Q&A
Replies: 1 comment 2 replies
-
request struct:
if I add unit test like this, it fails because c.Bind() doesn't work as expected for the path params; json params work as expected.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
am using echo v4.12.0 and am facing this issue in unit tests.
doing
c.SetParamNames()
,c.SetParamValues()
in test doesn't makec.Bind()
work for path paramsas a workaround, i need to add the param in the request struct in the unit test or add
c.Param()
in the actual function.reference to setting path params in test: https://echo.labstack.com/docs/testing#setting-path-params
Beta Was this translation helpful? Give feedback.
All reactions