Skip to content

Commit

Permalink
internal: Add zero middleware test for use-enhanced-reducer
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Mar 1, 2020
1 parent e59237c commit af77661
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/use-enhanced-reducer/src/__tests__/middleware.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ describe('createEnhancedReducerHook', () => {
};
};

test('runs through zero middlewares', () => {
const { result } = renderHook(() => {
return useEnhancedReducer(state => state, {}, []);
});
const [state, dispatch] = result.current;

const action = { type: 5 };
act(() => {
dispatch(action);
});
act(() => {
dispatch(action);
});
});

test('runs through a single middleware', () => {
const faker = jest.fn();
const logger = makeTestActionMiddleware(faker);
Expand Down

0 comments on commit af77661

Please sign in to comment.