We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My mocha tests are passing, but I am getting this new error about how 'dispatch' is not a function.
import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; const mockStore = configureMockStore([thunk]); it('should attempt to login', (done) => { const userInfo = {email: 'Fizz', password: 'Buzz'}; const userActions = require('../../../src/actions/userActions'); const store = mockStore({}); const dispatch = store.dispatch; const login = userActions.login; store.subscribe(() => { expect(store.getActions()[0].type).to.equal('LOG_IN'); expect(store.getActions()[0].data.email).to.equal('Fizz'); expect(store.getActions()[0].data.password).to.equal('Buzz'); done(); }); dispatch(userActions.asyncLogin(userInfo)(dispatch(login(userInfo)))); });
The text was updated successfully, but these errors were encountered:
This is my dispatch variable:
function (action) { return typeof action === 'function' ? action(dispatch, getState) : next(action); }
Sorry, something went wrong.
It looks like a JS error, you need to call store.dispatch or define dispatch as
store.dispatch
const dispatch = store.dispatch.bind(store);
No branches or pull requests
My mocha tests are passing, but I am getting this new error about how 'dispatch' is not a function.
The text was updated successfully, but these errors were encountered: