Sudarshan Raul
Aug 24, 2017 · 1 min read

Hello,

I was trying same. But encountered errors.

I have-

describe(“Map dispatch to props”, () => {
let mapDispatchToProps;
let exportDataSpy;

beforeEach(() => {
mapDispatchToProps = injector({
“../actions”: {
exportData: exportDataSpy
}
});
});

it(“should call exportData action”, () => {
const dispatchSpy = sinon.spy();
const {exportData} = mapDispatchToProps(dispatchSpy);
exportData();
expect(exportDataSpy).to.have.been.called();
expect(dispatchSpy).to.be.ok;
});
});

While I run my test case, I get error -

TypeError: mapDispatchToProps is not a function

Any suggestions.

)