Skip to content

Instantly share code, notes, and snippets.

@nemisj
Created June 21, 2016 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemisj/6259c82d65341ebcbc22494040350fd6 to your computer and use it in GitHub Desktop.
Save nemisj/6259c82d65341ebcbc22494040350fd6 to your computer and use it in GitHub Desktop.
const createMockActionContext = require('fluxible/utils').createMockActionContext;
module.exports = function (opts, contextMethods) {
const mockContext = createMockActionContext(opts);
const dispatcher = mockContext.dispatcherContext.dispatcher;
mockContext.dispatcherContext = dispatcher.createContext(contextMethods);
return mockContext;
}
const createMockActionContext = require('./create-mock-context.js');
createMockActionContext({
stores: []
}, {
pluginMethod() {
// implement mock for plugin method
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment