【发布时间】:2018-11-02 23:45:21
【问题描述】:
我在我的 create-react-app 项目中使用 jest 和酵素。当我运行npm test 时,我得到一个输出,其中显示了通过的测试文件的名称,但我希望输出也包括测试的名称。
例子:
Button.test.js
it ('renders button', () => {
const button = shallow(<Button type="save"/>);
expect(toJson(button)).toMatchSnapshot();
});
现在当我运行 npm test 时,输出只是:
通过 src/Button.test.js"
以及通过和失败的测试次数(测试成功时)。我希望输出包含“渲染按钮”和任何其他测试描述(例如运行 rspec 测试时输出的外观)。
【问题讨论】:
标签: reactjs jestjs enzyme create-react-app