Twig
Twig copied to clipboard
Add @codeCoverageIgnore to untestable compiled methods
I've been experimenting with adding my compiled templates to my code coverage reports and it works largely as expected. Templates that get executed return percentages accurate to the number of lines the tests actually cover. The only exception are the "meta" methods on the compiled template that aren't necessarily called by the tests.
This PR adds @codeCoverageIgnore comments to the compiled template for all non-display methods so the coverage report only lists lines from doDisplay.
I'm assuming that I will need to update some of the Twig tests to account for these new comments, but am curious if you'd be open to this change.
An example screenshot below. The last line shows line 46 out of the compiled template is never executed. The compiled template's getDebugInfo even correctly informs me that line 46 maps to line 4 in my .twig so I'll work on updating the line numbering next.
