当我运行npm test时,输出:

 mocha ./tests/ --recursive --reporter mocha-junit-reporter

并且所有测试运行良好。但是当我尝试调用mocha ./tests/flickr/mytest --reporter junit-reporter时,我得到了:
 Unknown "reporter": junit-reporter

如何正确通过?

最佳答案

mocha-junit-reporterreadme:

# install the package
npm install mocha-junit-reporter --save-dev

# run the test with reporter
mocha test --reporter mocha-junit-reporter --reporter-options mochaFile=./path_to_your/file.xml

09-11 07:47