Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function expectAction<T>(
- createAction: (payload?: T) => Action | PayloadAction<T>,
- type: string,
- payload?: T
- ): void {
- const action = createAction(payload);
- expect(action.type).toBe(type);
- if (payload) {
- expect((action as PayloadAction<T>).payload).toBe(payload);
- }
- }
- export function expectFailureAction(
- actionCreator: (error: HttpErrorResponse) => any,
- type: string
- ): void {
- const error = new HttpErrorResponse({ error: {} });
- expectAction(actionCreator, type, error);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement