Testing Failures in a Fetch Service with FetchTest Layer
How to test failures in a service? I have a basic fetch service with a FetchTest defined like so:
I don't know if this is "correct", but I'm not sure how else to trigger a failure in this case other than explicitly do so based on some variable passed in.
So open to a better way to do this part, but here is my test:
My thought is that I'd realistically pass in the error class to the
Am I asserting the wrong thing?
I don't know if this is "correct", but I'm not sure how else to trigger a failure in this case other than explicitly do so based on some variable passed in.
So open to a better way to do this part, but here is my test:
My thought is that I'd realistically pass in the error class to the
toBe or whatever the matcher should be here. But I always end up gettingAm I asserting the wrong thing?
