ember-cli / ember-cli/ember-cli-htmlbars

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

未关闭
#779 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
77
派生
65
PR 合并指标
30 天内没有已合并 PR

描述

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 https://github.com/ember-cli/ember-cli-htmlbars/pull/558 and https://github.com/ember-cli/ember-cli-htmlbars/pull/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 :smile:)

![image](https://github.com/ember-cli/ember-cli-htmlbars/assets/5949434/ed94281c-e26a-46ef-8bfd-ef2aba605a24)

贡献指南

这个仓库没有索引到贡献指南

调研方向

先为一个带有同位置模板的组件生成覆盖率报告,并将其与此处描述的生成源代码进行比较。使用相关的 pull request #558 和 #763 作为上下文。当注入的 import 和模板常量不再导致报告的源代码行发生偏移,也不再被计入源代码覆盖率时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
testing-qa
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。