Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Test runner: --test-reporter-destination should create the folder if not found

Aberta
#64,994 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
68/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Pouca atividade
Stack de tecnologia
javascript, node.js
Domínio
cli, testing-qa

Direção de pesquisa

Comece reproduzindo o problema com o comando fornecido node --test --experimental-code-coverage --test-reporter-destination="coverage/lcov.info" quando coverage não existir. Rastreie o tratamento do destino do reporter pelo test runner e verifique se a pasta de destino é criada antes de o relatório de coverage ser gravado, inclusive quando são necessárias pastas aninhadas.

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

Descrição

feature request test_runner
What is the problem this feature will solve?

Hi 👋

Fairly easy one:
I have node --test --experimental-code-coverage --test-reporter-destination="coverage/lcov.info" outputting the coverage file to the coverage folder.

However, if the coverage folder does not exist beforehand, an ENOENT is thrown.

Since storing the behavior of storing coverage in coverage/lcov.info, and having that folder in .gitignore is rather standard, it'd be nice to have Node creating the folder in which it will place the coverage report in case it doesn't exist.

Thanks :)

What is the feature you are proposing to solve the problem?

When writing coverage report, check if the destination folder exists, and if not, create it beforehand

What alternatives have you considered?
  • version controlling the coverage folder with a .gitkeep file, but it's cumbersome
  • Having the CLI test script in my package json create the folder itself, but that's quite inelegant to maintain for both Windows and Unix users
  • Switching to another test runner and losing all the charisma points that come with using the native one
Linguagem predominante
JavaScript
Estrelas
122k
Forks
37.4k
Merge médio
4d 2h
PRs com merge (30d)
277

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de nodejs/node

Todas as issues de nodejs/node

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

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