Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created February 19, 2019 06:20
Show Gist options
  • Save lydemann/355935f193ff5797cf6780fac09cfba6 to your computer and use it in GitHub Desktop.
Save lydemann/355935f193ff5797cf6780fac09cfba6 to your computer and use it in GitHub Desktop.
todo-list.reducers.spec.ts
describe('todoItemsLoadFailed', () => {
it('should return isLoading false and error', () => {
const initState = new TodoListInitState();
const error = new Error('http error');
const loadTodoItemsAction = new GenericAction(TodoListActionTypes.TodoItemsLoadFailed, error);
const newState = todoListReducers(initState, loadTodoItemsAction);
expect(newState.isLoading).toBe(false);
expect(newState.errors).toBe(error);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment