superagent-mocker
superagent-mocker copied to clipboard
Mocking an error response
I'm trying to mock a POST
call that would return a 401 Unauthorized
error for some testing. Any way to do this?
Can you show your code?
This works for me:
mock.get(url, (req) => ( {status: 500, body: {error:'batman'}} ))
It would be a good idea to have something in the README, @A