I am new to unit testing and still not completely getting it.
Suppose I have a resource /shop/:itemId
which calls a service and can throw various response codes like ITEM_NOT_FOUND
, SUCCESS
, FAILURE
, INVALID_EMAIL etc.
I am confused in what should I actually mock and what to test for the api end point? It would be great if you can explain with any small example.