如何在Yeoman Fountain项目中测试来自测试文件的app文件?

时间:2016-08-29 22:37:40

标签: reactjs yeoman karma-jasmine ecmascript-5

使用Fountain webapp生成器并使用React + Webpack + ES5 + Gulp创建TODO示例应用程序,并获取源代码:

如何配置Karma和/或Gulp和/或Webpack来分离应用源文件和测试源文件? (如何将class Button extends React.Component { props: Props; state: { display: 'static' | 'hover' | 'active'; }; static defaultProps: { visited: boolean }; onMouseEnter: () => void; onMouseLeave: () => void; onMouseDown: () => void; constructor(props: Props) { super(props); this.state = { display: 'static', }; const setDisplay = display => this.setState({display}); this.onMouseEnter = () => setDisplay('hover'); this.onMouseLeave = () => setDisplay('static'); this.onMouseDown = () => setDisplay('active'); } render() { let className = 'button ' + this.state.display; if (this.props.visited) { className += ' visited'; } return ( <div className={className} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave} onMouseDown={this.onMouseDown} onClick={this.props.onClick}> {this.props.title} </div> ); } } *.js分开?)

List of source files

0 个答案:

没有答案