Is it possible to show the actually code coverage with Istanbul, ignoring the "ignore" annotations?
e.g. Don't actually ignore next:
/* istanbul ignore next */
Our coverage reports 100% coverage but has ignores in the code.
Adding a lint rule to prevent usage of /* istanbul ignore ... */
, as you suggested in your comment, is probably the best solution.
However, as Istanbul is open source JavaScript software, you could also easily modify it, so that it ignores the /* istanbul ignore ... */
statements. Here is a quick and dirty ad-hoc solution (the proper solution would be to fork the project, modify the source, build and install it):
node_modules
folder./^\s*istanbul\s+ignore\s+
in the identified folder(s), which is part of the regex pattern, that Istanbul uses to properly identify the ignore comments.istanbul
and/or ignore
to some other terms, so that the existing /* istanbul ignore ... */
comments in your project source code are no longer matched (or get rid of the entire mechanism, but that might be more difficult and riskier).I do not recommend this approach. I just want to show, that it can be done. Depending on your specific setup, it may be easy or difficult to implement. I just tried it with an ES 2015 project in VS Code, and it worked fine.