Karma JS - How to include all all sources?

I have a mac application with + 10K lines, and we conduct tests and coverage through Karma.

I would like to include all the sources so that we can better understand that these are not covered by our tests.

I passed the includeAllSources parameter in the karma configuration, but I still canโ€™t see the karma showing the results for all files (only the report displays + 3K lines, more or less the number of lines that we know we have a test).

Am I doing something wrong? Is there any other way to include all sources ?

It uses a Karma plugin that was able to handle this, but the plugin no longer works (modified to make it work, but the results are the same).

Is there a way to pass the --include-all-sources parameter to Istanbul while it starts from Karma?

+5
source share
2 answers

This github question seems to be about your problem, and this pull request seems to fix it in version 0.5.2 of the karma coverage plugin.

I hope you are using an earlier version and just updating will solve your problem!

+1
source

You just need to add includeAllSources: true to coverageReporter , the reporter options.

Like this:

 coverageReporter: { includeAllSources: true ... } 
-2
source

Source: https://habr.com/ru/post/1232485/


All Articles