Closed DKunin closed 7 years ago
Good catch! Thank you!
Any progress on this ? It's a deal breaker for many use cases.
I had a quick look at the situation, it looks like superagent binds the events from the original response object I did try doing something similar where we patch Request.end() but couldn't get it to work, and couldn't figure out why. Sorry.
@A Dude, is this still an issue, maybe the issue should be closed?
If I attach a middleware to mocked superagent - whether I try to substitute an end callback, or have a trigger on 'end', 'response' events - nothing works. As soon as I unmock - everything works great.
MiddleWare example: