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

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

Aberta
#779 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
JavaScript
Estrelas
77
Forks
65
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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)

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Comece com um relatório de cobertura para um componente com um template co-localizado e compare-o com o código-fonte gerado descrito aqui. Use os pull requests relacionados #558 e #763 como contexto. Está concluído quando o import injetado e a constante do template não deslocarem mais as linhas de código-fonte reportadas nem forem contabilizados como cobertura de código-fonte.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
javascript
Domínio
testing-qa
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.