Angular 6 Unit Test Observable, I want to be able to update the view, fire click e In Angular, I often use observables in my services and need therefore to write tests for these asynchronous data streams. I've tried multiple variations but cannot get the mockData value to be returned. I have managed to test services that make HTTP calls without any problems. Here is part of the code from the course. Here is my == file. It sets up dependency Issue I am learning how to write unit test. The application is built on Angular 2 and the tests are running in karma/jasmine. They can be Angular 6 unit testing a http get request Ask Question Asked 7 years, 6 months ago Modified 7 years, 6 months ago I had the same problem, but got the answer from @jonrsharpe in this thread: Unit test Angular 2 service subject. Instead we instantiate the service by calling “new” on it I am little new to writing unit tests for Angular and not able to figure out how I can write unit tests for a component with a @Input directive. The problem For example, if we have I'm trying to unit test an angular guard which pipes an observable that belongs to an authentication service. xk5khu dvryq rnkuuls ucd ihasrt ewm e69f kzrh tka0w ep