Created
February 19, 2019 06:17
-
-
Save lydemann/916404e2b162d60ae118195dc71c150c to your computer and use it in GitHub Desktop.
todo-list.effects.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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