Intercept and mock outgoing Node.js network TCP connections and HTTP requests for testing. Intercepts and gives you a Net.Socket, Http.IncomingMessage and Http.ServerResponse to test and respond with. Super useful when testing code that hits remote servers.
Other
637
stars
48
forks
source link
Wire up internals for node.js 9.6.0+ compatibility #49
Fixes #48
This feels quite hackish, but I couldn't find another way to make it work except for PRing node.js core. It kinda feels like this line should also have checked for
parser.socket.server[kIncomingMessage]
: https://github.com/nodejs/node/blob/15e41a9951c425913c43073ba5f6af04c0867715/lib/_http_common.js#L78 -- but even that would only get us halfway there.