Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code coverage off by 2 lines in components with co-located template #779

Open
robinborst95 opened this issue Sep 27, 2023 · 1 comment
Open

Comments

@robinborst95
Copy link
Contributor

In components with a co-located template, the plugin adds import { hbs } and const __COLOCATED_TEMPLATE__ = ... to the source file, and that is affecting the code coverage. Not only does this affect the percentage itself, as const __COLOCATED_TEMPLATE__ = ... is seen as a line that is covered without it being part of the source code, it also makes it very difficult to look at a coverage report as the lines are off by 2 (see screenshot)

In #558 and #763, something similar is addressed, but then just for source maps which appeared to be resolved without the fixes. However, for the code coverage this is still relevant, and placing the lines at the end would at least solve the off-by-2 issues (would have been fun if it was the typical off-by-1 error 😄)

image

@wagenet
Copy link

wagenet commented Nov 15, 2023

Code coverage tools generally use the source maps as well, so fixing those should resolve the coverage issues. Indeed, that's my primary motivation to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants