Published onSeptember 13, 2023How to Unit Test Error Response Handling in AngularAngularUnit-TestingHttptestingcontrollerHttpclienttestingmoduleTestrequestIn this post we’ll quickly see how to mock an error response in order to test that an HttpInterceptor is redirecting to a login page when a 401 status code is returned.