Skip to content

Instantly share code, notes, and snippets.

@cakeinpanic
Last active October 8, 2017 07:14
Show Gist options
  • Save cakeinpanic/553125ac346e66b2ae028eb2e2cc7dc5 to your computer and use it in GitHub Desktop.
Save cakeinpanic/553125ac346e66b2ae028eb2e2cc7dc5 to your computer and use it in GitHub Desktop.
gist for medium
it('someMethod would be ran with iterator each second', fakeAsync(() => {
myService.someMethod();
tick(2 * 1000);
expect(logger.logObservable).toHaveBeenCalledTimes(2);
expect(logger.logInterval).toHaveBeenCalledTimes(1);
// tell jasmine we don't need to emulate async anymore in this case
discardPeriodicTasks();
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment