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