Jasmine Angular unit test – Cannot read properties of undefined I want to test the error part of the http call in the myService.ts file.