首页 > 解决方案 > 如何使用 mocha-junit-reporter 打印失败的测试

问题描述

我正在使用 mochajs 和 mocha-juint-reporter。

这是我正在运行的命令:

"test:junit": "mocha test --recursive --reporter mocha-junit-reporter --reporter-options mochaFile=./reports/junit/unit-test-results.xml --reporter-options outputs=false --reporter-options includePending=true",

它运行正常,并生成以下报告:

<?xml version="1.0" encoding="UTF-8">
  <version>1.0</version>
</?xml>
<0 name="Mocha Tests" time="0.3600" tests="2442" failures="1" skipped="25">
  <name>Mocha Tests</name>
</0>

如何让它在报告中包含失败的测试?我尝试了几种记者选项,但似乎没有任何效果。

我原以为输出失败的测试是标准的

提前致谢!

标签: unit-testingjunitmocha.js

解决方案


推荐阅读