2
我的反應類組件看起來是這樣的:如何Jest.mock終極版形式的現場
import { Field, reduxForm, propTypes } from 'redux-form';
class DepositAmountInput extends Component {
render() {
return (
<View>
<Field
component={NumberInputField}
props={{
onChange: this.handleInput,
onBlur: this.handleOnBlur
}}
/>
</View>
);
}
}
export default DepositAmountInput
在我這個組件玩笑測試,我怎麼能嘲笑終極版形式的Field組件?我正在尋找這樣的事情:
.mock('redux-form/lib/Field',()=>'Field');
謝謝!