Following the IntelliJ instructions for Enabling running tests with coverage in Karma I'm able to run my karma tests successfully and view all my expected results in the generated coverage directory, however in IntelliJ's Coverge tab only my spec.js files which were used for testing show statistics next to them and none of the code it actually tested has any coverage statistics. Why are statics only shown next to my tests?
Asked
Active
Viewed 202 times
1 Answers
0
I solved my own problem. The directory containing the code I'm testing is in a target directory which IntelliJ was configured to exclude.
Solved this by going to 'File' > 'Project Structure' then under 'Project Settings' > 'Modules' select my projects target directory containing the code I want covered and de-selecting 'Excluded' button. Then click Apply and run test with code coverage again and statistics show up as expected

Thomas Kagan
- 440
- 3
- 16