Skip to content

Instantly share code, notes, and snippets.

@LayZeeDK
Created October 25, 2018 19:08
Show Gist options
  • Save LayZeeDK/dad64ab47b7f680b56f4efea26e18e28 to your computer and use it in GitHub Desktop.
Save LayZeeDK/dad64ab47b7f680b56f4efea26e18e28 to your computer and use it in GitHub Desktop.
Heroes: Testing deletion of a hero
it('emits the specified hero when server fails', fakeAsync(() => {
heroServiceStub.deleteHero.and.returnValue(
throwError(new Error('timeout'), asapScheduler));
const storm: Hero = femaleMarvelHeroes.find(x => x.name === 'Storm');
container.delete(storm);
tick();
const emittedHeroes: Hero[] = observer.calls.mostRecent().args[0];
emittedHeroes.sort(compareIdAscending);
expect(emittedHeroes).toEqual(femaleMarvelHeroes);
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment