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 run coverage report even without adding coverage param #10851

Closed
pruchay opened this issue Nov 20, 2020 · 4 comments
Closed

Jest run coverage report even without adding coverage param #10851

pruchay opened this issue Nov 20, 2020 · 4 comments

Comments

@pruchay
Copy link

pruchay commented Nov 20, 2020

🐛 Bug Report

Looks like Jest try to run coverage report even if I don't ask him :)

To Reproduce

Steps to reproduce the behavior:

  1. Add testResultsProcessor to config
  2. Run test with jest

Expected behavior

We have two scripts to run unit tests:
"test": "jest --no-cache" and
"test:coverage": "npm run test -- --coverage"

When I run first command I expect that Jest run only unit tests and nothing more. And if I need coverage reports I need to run second command.
But currently when I run first command it also try to run coverage report, but it fails, because can't create folder for tests. If I will run second command it works well.
I think it's because adding testResultsProcessor param to Jest config in packega.json.

Link to repl or repo (highly encouraged)

Link https://repl.it/@pruchay/jest-playground#package.json
If you run jest it will create coverage report, but if you remove "testResultsProcessor": "jest-sonar-reporter" from package.json it will not create coverage report.

envinfo

 System:
    OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 10.19.0 - /usr/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
  npmPackages:
    jest: ^25.5.4 => 25.5.4 
@pruchay
Copy link
Author

pruchay commented Nov 23, 2020

We find two possible quick solutions for us.
First is to run command like this jest --no-cache --testResultsProcessor=''
Second is to delete "testResultsProcessor" from jest config and add testResultsProcessor param to script with coverage:

npm run test -- --coverage --testResultsProcessor='jest-sonar-reporter'.

So we choose second one. But I think, it will be better to fix it in library :)

@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Feb 17, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2023
@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 Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants