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:
<
I recommend this approach, which I think is more elegant:
expectAsync(carService.getCars().toPromise()).toBeResolvedWith(myExpectedValue);
You can also provide your own async matchers using: Jasmine Matcher