Skip to content

Instantly share code, notes, and snippets.

@LayZeeDK
Last active October 10, 2018 15:48
Show Gist options
  • Save LayZeeDK/74f6465266d5a3d73cb228b6d180d819 to your computer and use it in GitHub Desktop.
Save LayZeeDK/74f6465266d5a3d73cb228b6d180d819 to your computer and use it in GitHub Desktop.
Heroes: Testing addition of a hero
describe('adds a hero', () => {
it('emits the specified hero when server responds', fakeAsync(() => {
const wonderWoman = 'Wonder Woman';
container.add(wonderWoman);
tick();
expect(observer).toHaveBeenCalledWith([
...femaleMarvelHeroes,
{ id: 42, name: wonderWoman },
]);
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment