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:
<
The way I've managed to get it to work is to subscribe and call done after the expects.
it('should equal bar', (done: any) => { bar.getFoo().subscribe(v => { expect(v).toBe('foo'); done(); }); });