问题
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