-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add more tests #3
Comments
@moll I think I addressed all your concerns? Can you think of anything else I should be testing? |
Oh, well done! You're of course bound to see more bugs as it's effectively the same path Nock took — hooking into the requests/streams from the outside and having to ensure the API remains the same. For example, I have a feeling the 693fc94 test case isn't exactly right. You're calling var Http = require("http")
Http.get("http://example.com", function(res) {
setTimeout(function() {
res.on("data", (data) => console.log("Data:", data.toString()))
}, 500)
}) The hook into response's Some other possible issues:
|
Another great catch, thanks! I made an issue here: #17
I looked into it, but I couldn't figure out how to pipe with the low-level http APIs. I tested it with a request using
My thinking here was to normalize the |
|
I suppose create a writable stream, call
That both ways., first to
Oh, I wouldn't care for performance either. Just correctness. I'm not sure you're normalizing the response --- seems more like it's converting decoded data back into a buffer, but what encoding is that presuming? All HTTP responses aren't text...
The less overwriting, the better, of course, though you're still forced to mirror the behavior of API parts you've overwritten and risk Node-internals go behind the WritableStream public API. Then again, there's no real alternative. |
Follow up to moll/node-mitm#76 (comment) thanks @moll
OutgoingMessage.prototype.end
#5got.stream.post
#2The text was updated successfully, but these errors were encountered: