moll / node-mitm

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

fix(node v6): ref and unref are expected on sockets #35

Closed vvo closed 7 years ago

vvo commented 7 years ago

Node.js current code does reference ref and unref, my tests are failing on node 6.5.0 using latest node-mitm. Possibly because of using ssl sockets somewhere.

This completely fix it, no idea how to create a test though

moll commented 7 years ago

Hey, thanks again!

Does it fail consistently? Mind sharing the backtrace? I'd still like a failing test case, so perhaps we can get to the bottom of it together. ;)

moll commented 7 years ago

Actually, I think just calling ref on the client socket delegates to the underlying handle and that's a sufficient test case. I'll write tests for all permutations.

vvo commented 7 years ago

Thanks :)

moll commented 7 years ago

Thanks again. Released as Mitm v1.3.1.