You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to migrate from axios/axios-mock-adapter to fetch/nock and I'm having really hard time understanding why some requests are not being matched. I use nock.disableNetConnect() to ensure that all requests are "caught" but even with debugging enabled, I don't know what nock is doing:
NOCK:COMMON 14419: options.host: oauthconfigapp.automationanywhere.digital
NOCK:COMMON 14419: options.hostname in the end: "oauthconfigapp.automationanywhere.digital"
NOCK:COMMON 14419: options.host in the end: "oauthconfigapp.automationanywhere.digital:443"
NOCK:INTERCEPT 14419: interceptors for "oauthconfigapp.automationanywhere.digital:443"
NOCK:INTERCEPT 14419: filtering interceptors for basepath https://oauthconfigapp.automationanywhere.digital:443
NOCK:INTERCEPT 14419: falling back to original ClientRequest
NOCK:COMMON 14419: options.host: oauthconfigapp.automationanywhere.digital:443
NOCK:COMMON 14419: options.hostname in the end: "oauthconfigapp.automationanywhere.digital"
NOCK:COMMON 14419: options.host in the end: "oauthconfigapp.automationanywhere.digital:443"
NOCK:INTERCEPT 14419: Net connect not enabled for oauthconfigapp.automationanywhere.digital:443
NOCK:SCOPE:LOCALHOST 14419: reply.headers: {}
NOCK:SCOPE:LOCALHOST 14419: reply.rawHeaders: [ 'Content-Type', 'application/json' ]
NOCK:SCOPE:LOCALHOST 14419: reply.headers: {}
NOCK:SCOPE:LOCALHOST 14419: reply.rawHeaders: []
What's NOCK:COMMON 14419: options.host? Is it a request being handled?
What does interceptors for mean? Is it an event? Is it matching? Is it supposed to be followed by a list of interceptors?
What about falling back to original ClientRequest? Why is it falling back? Why is my nock("https://oauthconfigapp.automationanywhere.digital").persist().post("/*").reply(200, {}).get("/*").reply(200, {}) not catching these requests?
Alternatives
Improve the logging to clarify what's actually happening, for example:
NOCK:REQUEST: new request POST https://oauthconfigapp.automationanywhere.digital:443/blablah with body
NOCK:REQUEST: matches '/*'
NOCK:REQUEST: intercepted
NOCK:REQUEST: new request GET https://oauthconfigapp.automationanywhere.digital:443/blablah?url=param
NOCK:REQUEST: does not match
NOCK:REQUEST: fell through, but net connections disabled
If the feature request is accepted, would you be willing to submit a PR?
yes
The text was updated successfully, but these errors were encountered:
Please avoid duplicates
Context
I'm trying to migrate from axios/axios-mock-adapter to fetch/nock and I'm having really hard time understanding why some requests are not being matched. I use
nock.disableNetConnect()
to ensure that all requests are "caught" but even with debugging enabled, I don't know what nock is doing:NOCK:COMMON 14419: options.host
? Is it a request being handled?interceptors for
mean? Is it an event? Is it matching? Is it supposed to be followed by a list of interceptors?falling back to original ClientRequest
? Why is it falling back? Why is mynock("https://oauthconfigapp.automationanywhere.digital").persist().post("/*").reply(200, {}).get("/*").reply(200, {})
not catching these requests?Alternatives
Improve the logging to clarify what's actually happening, for example:
If the feature request is accepted, would you be willing to submit a PR?
The text was updated successfully, but these errors were encountered: