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
When I mocked a response just with 301 status code, I got an error with a message: 301 response missing Location header. After adding the location header, there was another error with a message: gock: cannot match any request.
defergock.Off()
gock.New("https://domain.com/").
Get("/initial").
Reply(302).
SetHeader("Location", "https://domain.com/redirected")
gock.New("https://domain.com/").
Get("/redirected").
Reply(200).
File("test.json")
// call API domain.com/initial and assert you get a 200 with the redirect bodyassert.True(t, gock.IsDone())
When I mocked a response just with 301 status code, I got an error with a message: 301 response missing Location header. After adding the location header, there was another error with a message: gock: cannot match any request.
The code is shown as below:
The text was updated successfully, but these errors were encountered: