Open kettanaito opened 3 weeks ago
I think the test failures are related to some HTTP requests being bypassed when they shouldn't be. Perhaps the super.addRequest()
actually schedules the request to be performed. I need to look into that and make sure that's only called for passthrough requests if that's the case.
The flow is this:
If we call this.customAgent.addRequest()
, it will likely tap into super.addRequest()
of the http.Agent
it extends, triggering the actual connection.
I'm trying to patch the http.Agent
class so that any custom agents that extend it don't instantiate actual requests by tapping into super
. Instead, the actual request will be instantiated in the MockHttpAgent
in individual request's context.