【发布时间】:2017-07-10 04:55:02
【问题描述】:
我想在我的 TypeScript 项目中使用 Mocha,power-assert,当我使用 Chai 时,istanbul 可以生成 Coverage HTML 报告,当我切换到 power-assert 时,istanbul 只能报告覆盖率但无法生成具有相同配置的 HTML 报告和错误退出。而且如果测试出现错误,摩卡也会坏掉。 它与 power-assert 中的路径问题相同。 我使用 nyc 报告覆盖率。
我的测试命令:
"test": "mocha --compilers ts:espower-typescript/guess test/*.ts",
"test:coverage": "nyc npm test"
我已经建立了一个 repo 来重现这个问题:https://github.com/LiJinyao/bug-power-assert
有没有人有使用 power-assert 设置具有代码覆盖率的 TypeScript 测试环境的经验?
【问题讨论】: