Replies: 2 comments 7 replies
-
|
Hello @mlms13 ,
Thank you :)
This is not a workaround, this is exactly how it's designed to be.
I did consider that but I could not find a suitable solution. In case you know one, please let me know and I'll try it. |
Beta Was this translation helpful? Give feedback.
-
|
Dear @mlms13 , Please check out the version Amongst other improvements, there is new testing approach that is completely detached from the mocks of your testing frameworks, moreover it offers a completely operational mocks for request and response, enabling its usage outta box without any tricks, thus eliminating the confusion. Please let me know how it works. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Absolutely love
express-zod-api, thanks so much for all the work you've put into it!We encountered a bit of an interesting situation using the
testEndpointhelper in our tests. At a high level:req.get('X-API-Token')testEndpointalways fail becausereq.get is not a functionFor now, we've worked around this by providing our own implementation of Express's
request.getmethod when setting up therequestMockfortestEndpoint, like so:I'm curious if there's a better way to do this, or if
express-zod-apiwould consider adding a more robust baserequestMockthat more closely matches Express's own request object.Happy to provide more detailed repro steps for how we got into the situation or more details about how we implemented our solution if that would be helpful. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions