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.
-
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
testEndpoint
helper in our tests. At a high level:req.get('X-API-Token')
testEndpoint
always fail becausereq.get is not a function
For now, we've worked around this by providing our own implementation of Express's
request.get
method when setting up therequestMock
fortestEndpoint
, like so:I'm curious if there's a better way to do this, or if
express-zod-api
would consider adding a more robust baserequestMock
that 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