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

jest --init does not enable collectCoverage #11348

Closed
davc0n opened this issue Apr 27, 2021 · 2 comments · Fixed by #11353
Closed

jest --init does not enable collectCoverage #11348

davc0n opened this issue Apr 27, 2021 · 2 comments · Fixed by #11353

Comments

@davc0n
Copy link
Contributor

davc0n commented Apr 27, 2021

🐛 Bug Report

Not sure if a bug or if my thinking is just wrong.
During init, when prompted for coverage report, in case of positive answer the generated config has not collectCoverage set to true. Additionally, in case of negative answer it still asks for which provider to choose, which shouldn't really matter in that case and consequently not asked.

To Reproduce

  • Run jest --init
  • Do you want Jest to add coverage reports? … yes

Expected behavior

Config file should have collectCoverage: true.

envinfo

  System:
    OS: Linux 5.11 Arch Linux
    CPU: (8) x64 AMD Ryzen 5 PRO 3500U w/ Radeon Vega Mobile Gfx
  Binaries:
    Node: 14.16.0 - /usr/bin/node
    npm: 7.10.0 - /usr/bin/npm
  npmPackages:
    jest: ^26.6.3 => 26.6.3 
@SimenB
Copy link
Member

SimenB commented Apr 28, 2021

I think it makes sense to still ask about coverageProvider as you might want to use --coverage later even if you don't want it in config.

Not putting it in when responding positively sounds like a bug, though. Wanna send a PR fixing it?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants