【问题标题】:How to generate a report file using facebook Jest如何使用 facebook Jest 生成报告文件
【发布时间】:2015-10-29 07:14:59
【问题描述】:

我正在使用Jest 在我的应用程序上运行单元测试。

有没有办法让它生成任何类型的报告文件?我想将报告与Bamboo 整合。

【问题讨论】:

  • 一般来说,你需要一些能以 xUnit.xml 格式输出的东西——this sample project on Github 正是这样做的,但不能让它适用于最新版本的 Jest。

标签: node.js bamboo jestjs grunt-jest gulp-jest


【解决方案1】:

安装这个

https://www.npmjs.com/package/jest-junit

将此添加到您的 jest.config.file 中

"reporters": [
        "default",
        ["jest-junit", { outputName: "junitreport.xml" }]
    ]

在竹子上使用junit解析器,配置它以这种方式查找文件

**/junitreport.xml

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多