Jest test passed but get Error: connect ECONNREFUSED 127.0.0.1:80 at the end
So i figured out and the solution is quite easy. I cant explain why though.
this req.get('api/v1/users/')
it should be /api/v1/users
you need a leading /
.
For Frontend...
If you are making use of axios
and come across this error, go to the testSetup.js
file and add this line
axios.defaults.baseURL = "https://yourbaseurl.com/"
This worked for me. So, typically, this is a baseURL issue.