Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.