-
Notifications
You must be signed in to change notification settings - Fork 40
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
"Request" local files #47
Comments
I think I found the solution. |
Note that the current version of the library works a bit differently. You still should be able to use |
I see. The problem is that what I'm testing is a function that internally uses So I think I come back to my first thought... Considering the option to support the |
Does |
No, as far as I know, it doesn't 😞 |
The most logical way to add this is to add the feature to |
I agree this should be the way to go. I submitted an issue there. |
Hi there. First of all, thanks for this great work.
I'm currently developing an application which needs to request some user provided URLs. My issue is related with testing it.
Testing has a lot to do with trusting, and I trust that
req
works fine because it has its own test suite and it is being used by the community. For this reason, I don't like and I don't see the reason why my tests should be non-deterministic because of the need to reach external end-points which could be not available at some point.For my own confidence, it would be enough to be able to provide in my test suite a location for a local file which content would act as a response body.
Of course, I see some inconvenient with this. Maybe it is pushing the abstraction out of its scope, because, which method should that request have and which headers should the response have?
Maybe another module
Nework.HTTP.Req.Testing
could be added implementing the needed logic, but surely some changes in the core system would be necessary. Maybe adding anotherScheme
constructor calledLocal
, or maybe to makereq
function not depend onUrl
but on something implementing a newUrl
type class.How do you see it? Am I missing a better approach?
Thanks
The text was updated successfully, but these errors were encountered: