【发布时间】:2017-06-27 08:02:48
【问题描述】:
如何测试 Reaect-Redux 组件并模拟其上下文和操作?
这样,它找不到任何动作:
const wrapper = mount(
<S437TransactionAuth
store={store}
s437updateGui="{mock.action.s437updateGUI}"
setCurrentUserId="{mock.action.setCurrentUserId}"
/>,
mockContext
);
这找不到模拟动作或上下文
const wrapper = mount(
<Provider store={store}>
<S437TransactionAuth
s437updateGui="{mock.action.s437updateGUI}"
setCurrentUserId="{mock.action.setCurrentUserId}"
/>
</Provider>,
mockContext
);
标准做法是什么?我正在使用 Mocha,出于我无法控制的原因。
【问题讨论】:
标签: reactjs mocha.js react-redux