Skip to content

Instantly share code, notes, and snippets.

@slightlytyler
Last active January 11, 2018 16:48
Show Gist options
  • Save slightlytyler/1e2735efa68dcc4d3b9024c04da62d4b to your computer and use it in GitHub Desktop.
Save slightlytyler/1e2735efa68dcc4d3b9024c04da62d4b to your computer and use it in GitHub Desktop.
import * as actions from './actions';
const dispatch = spy();
const getState = () => ({
...your mocked state
});
describe('Action A', () => {
it('should dispatch a correctly formatted action', () => {
actions.actionA('first arg', 'second arg')(dispatch, getState);
expect(dispatch).to.have.been.calledWith({
...expected action shape
});
dispatch.reset();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment