How do you find the code coverage for angular 2 code? Is there any plugin for vs code editor or webstorm that I can use? I am using Jasmine and Karma for unit testing of my code
First install the dependencies.
npm install karma karma-jasmine karma-chrome-launcher karma-jasmine-html-reporter karma-coverage-istanbul-reporter
Then run ng test.
ng test --code-coverage
Then run the server that shows you your report.
http-server -c-1 -o -p 9875 ./coverage
You should see something like this:
I wrote a blog post about this here.