I am writing some unit tests that make an request to a given endpoint lets call it myAPI in my tests I've wrote a setup part to configure the gock to mock myAPI endpoint
Unfortunately I am getting 401, it seems that gock it is not intercepting the request, as consequence it is reaching the real API and that why I am getting unauthorized. What I am doing wrong here ? What did I miss ?
Note: My user dont have admin rights in the machine. Is that a problem to gock ?
I am writing some unit tests that make an request to a given endpoint lets call it
myAPI
in my tests I've wrote a setup part to configure the gock to mockmyAPI
endpointdoRequest
is using default http.Client.Code in
doRequest
that executed the request:Unfortunately I am getting 401, it seems that gock it is not intercepting the request, as consequence it is reaching the real API and that why I am getting unauthorized. What I am doing wrong here ? What did I miss ?
Note: My user dont have admin rights in the machine. Is that a problem to gock ?