Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created February 19, 2019 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lydemann/916404e2b162d60ae118195dc71c150c to your computer and use it in GitHub Desktop.
Save lydemann/916404e2b162d60ae118195dc71c150c to your computer and use it in GitHub Desktop.
todo-list.effects.spec.ts
it('should fail and return an action with the error', () => {
const action = new LoadTodoList();
const error = new Error('some error') as any;
const outcome = new TodoItemsLoadFailed(error);
actions = hot('-a', { a: action });
const response = cold('-#|', {}, error);
todoListService.getTodos.and.returnValue(response);
const expected = cold('--(b|)', { b: outcome });
expect(effects.loadTodoList$).toBeObservable(expected);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment