npm test --codecoverage doesn't generate report

百般思念 提交于 2021-02-05 07:10:45

问题


Have no ideas why when I hit

npm test --codecoverage

All test is being executed, however I see an empty '/coverage' folder with no single report. I use angular-cli

What I'm doing wrong?


回答1:


If you have the CLI installed globally, The command is

ng test --code-coverage

If you want to use the npm scripts, you will need to do

npm test -- --code-coverage



回答2:


I believe the command is

npm test --coverage

There is no check on arguments passed, so you can put in anything you like without it throwing an error. But to trigger code coverage, I believe you have to put in --coverage



来源:https://stackoverflow.com/questions/42435935/npm-test-codecoverage-doesnt-generate-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!