Created
October 25, 2018 19:08
-
-
Save LayZeeDK/dad64ab47b7f680b56f4efea26e18e28 to your computer and use it in GitHub Desktop.
Heroes: Testing deletion of a hero
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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