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

No option to ignore path(s) when collecting test coverage #1191

Closed
timothytong opened this issue Jun 20, 2016 · 5 comments
Closed

No option to ignore path(s) when collecting test coverage #1191

timothytong opened this issue Jun 20, 2016 · 5 comments

Comments

@timothytong
Copy link

Currently the only option to not generate coverage for certain files or directories is to use the --collectCoverageOnlyFrom option in our package.json files. However, I ran into a problem when I wanted to test all js files in my codebase but just a couple files that are already being tested somewhere else (please don't ask why there are reasons behind that). IMHO, enumerating all those files would

  1. be a pain in the butt
  2. result in a gigantic package.json file
  3. just not make sense at all..
    In conclusion, I wish there was a --collectCoverageIgnorePaths option for developers.
@cpojer
Copy link
Member

cpojer commented Jun 20, 2016

I agree! Would you mind sending a pull request for this? This should be in the config and not part of the CLI and should be fairly straightforward to implement. I'd call it coverageIgnorePaths.

@bookman25
Copy link
Contributor

It'd be nice if it used minimatch as well and not regex.

@cpojer
Copy link
Member

cpojer commented Jun 21, 2016

This unfortunately has to use regex to stay consistent with the rest of Jest.

Changing Jest to other matching algorithms is part of our plan to rewrite configs, but shouldn't be done in this change :)

@cpojer
Copy link
Member

cpojer commented Jul 1, 2016

This is going to be in #1233 and will be tagged soon! :)

@cpojer cpojer closed this as completed Jul 1, 2016
@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 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants