Skip to content

Instantly share code, notes, and snippets.

@atamanroman
Created February 6, 2018 10:24
Show Gist options
  • Save atamanroman/d5b66fe90ec2d4248c023dfe0d02d69d to your computer and use it in GitHub Desktop.
Save atamanroman/d5b66fe90ec2d4248c023dfe0d02d69d to your computer and use it in GitHub Desktop.
subscribe expect done
describe('getBooks()', () => {
it('should return the whole list of books with an Observable', (done) =>
inject([BookStaticAsyncDataService], (service: BookStaticAsyncDataService) => {
service.getBooks().subscribe(b => {
expect(b.length).toBe(3);
done();
});
})());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment