What is the correct way of unit testing a service returning an Observable result in Angular 2? Let\'s say we have a getCars method in a CarService service class:
<
https://angular.io/guide/testing currently shows a few ways. Here is one:
it('#getObservableValue should return value from observable', (done: DoneFn) => { service.getObservableValue().subscribe(value => { expect(value).toBe('observable value'); done(); }); });