Skip to content

Instantly share code, notes, and snippets.

@LayZeeDK
Last active October 10, 2018 16:46
Show Gist options
  • Save LayZeeDK/0ea4c11f948f009178204fdfa7fa195b to your computer and use it in GitHub Desktop.
Save LayZeeDK/0ea4c11f948f009178204fdfa7fa195b to your computer and use it in GitHub Desktop.
Heroes: Testing addition of a hero
it('does not emit the specified hero when server fails', fakeAsync(() => {
heroServiceStub.addHero.and.returnValue(
throwError(new Error('server error'), asapScheduler));
const scarletWitch = 'Scarlet Witch';
container.add(scarletWitch);
tick();
expect(observer).not.toHaveBeenCalledWith([
...femaleMarvelHeroes,
{ id: 42, name: scarletWitch },
]);
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment