Skip to content

Instantly share code, notes, and snippets.

@LayZeeDK
Last active October 25, 2018 18:58
Show Gist options
  • Save LayZeeDK/2c4ac61894c269c1738f2d8f9340b70c to your computer and use it in GitHub Desktop.
Save LayZeeDK/2c4ac61894c269c1738f2d8f9340b70c to your computer and use it in GitHub Desktop.
Heroes: Testing deletion of a hero
describe('deletes a hero', () => {
it(`delegates to ${HeroService.name}`, () => {
const gamora: Hero = femaleMarvelHeroes.find(x => x.name === 'Gamora');
container.delete(gamora);
expect(heroServiceStub.deleteHero).toHaveBeenCalledTimes(1);
expect(heroServiceStub.deleteHero).toHaveBeenCalledWith(gamora);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment