Angular 2 Unit Testing Observable Errors (HTTP)
问题 I am trying to write unit tests for my API service but have some trouble catching HTTP errors. I am following this guide along with the Angular2 docs since the guide is (slightly) out of date in some minor areas. All unit tests pass apart from those where an error is thrown by the service (due to error HTTP status code). I can tell this by logging out response.ok . From what i've read this has something to do with the unit tests not executing asynchronously, hence, not waiting for the error