1
我试着让摩卡记者输出HTML文件,使用mocha.opts
配置文件:声明输出文件
--compilers coffee:coffee-script/register
--reporter html-cov > tests.html
然而,这总是返回如下:
→ mocha
/usr/local/lib/node_modules/mocha/bin/_mocha:432
if (!files.length) throw new Error("cannot resolve path (or pattern) '"
^
Error: cannot resolve path (or pattern) '>'
如果我直接在shell中传递命令mocha --reporter html-cov > testes.html
,它确实有效。
我错过了什么?
您错误地将使用摩卡功能的shell重定向(将命令的输出写入文件)。但是,添加该功能会很好!你可以在[GitHub repo](https://github.com/visionmedia/mocha)中添加一个问题,甚至尝试自己实现它。 – Esteban