0
componentWillMount() {
// redux store
CrudActions.getUsers();
}
如何使用笑话来呼叫我的减速器?我想写的行为,而不是调用另一个CrudActions的SETALL功能测试。componentWillMount内的测试功能
到目前为止,我只能够调用componentWillMount
test('calls `componentWillMount` before rendering',() => {
const onWillMount = jest.fn();
CrudList.prototype.componentWillMount = onWillMount;
mount(<CrudList />);
expect(onWillMount).toBeCalled();
});