Skip to content

Instantly share code, notes, and snippets.

@byrichardpowell
Created May 6, 2016 09:33
Show Gist options
  • Save byrichardpowell/5a5d2a77e1d8b2cc6ecdf29baa7d28aa to your computer and use it in GitHub Desktop.
Save byrichardpowell/5a5d2a77e1d8b2cc6ecdf29baa7d28aa to your computer and use it in GitHub Desktop.
Mocking redux action creators
_ = require('underscore')
InventoryActions = require('action-creators/entities/inventory')
actions = _.keys(InventoryActions)
mock =
mock: ->
_.each actions, (action) =>
@[action] = jasmine.createSpy(action + "Spy").and.returnValue(action)
resetMock: ->
@mock()
return @
module.exports = mock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment