Created
May 6, 2016 09:33
-
-
Save byrichardpowell/5a5d2a77e1d8b2cc6ecdf29baa7d28aa to your computer and use it in GitHub Desktop.
Mocking redux action creators
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
_ = 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