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

setup{Files,FilesAfterEnv} included in coverage report #7761

Closed
chrisblossom opened this issue Jan 30, 2019 · 5 comments · Fixed by #7790
Closed

setup{Files,FilesAfterEnv} included in coverage report #7761

chrisblossom opened this issue Jan 30, 2019 · 5 comments · Fixed by #7790

Comments

@chrisblossom
Copy link
Contributor

chrisblossom commented Jan 30, 2019

🐛 Bug Report

setupFiles and setupFilesAfterEnv are included in coverage report. global{Setup,Teardown} are not included as expected.

I don't think this is expected, but if it is please close this issue. I'll just add the necessary files to coveragePathIgnorePatterns.

To Reproduce

Enable setupFiles and setupFilesAfterEnv and run coverage report.

Expected behavior

setupFiles and setupFilesAfterEnv are not shown in coverage report.

Link to repl or repo (highly encouraged)

chrisblossom/jest-issue-7761

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS 10.14.3
    CPU: (16) x64 Intel(R) Xeon(R) W-2140B CPU @ 3.20GHz
  Binaries:
    Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm
  npmPackages:
    jest: 24.0.0 => 24.0.0
@jeysal
Copy link
Contributor

jeysal commented Jan 30, 2019

I guess it could be argued that setupFiles{,afterEnv} are somewhat close to beforeAll and could thus be considered part of each test file, but I don't really have a strong opinion whether they should be. Not sure if there's any significant pros or cons to including them?

@SimenB
Copy link
Member

SimenB commented Jan 30, 2019

I think they, like test files, should by default be ignored by coverage. PR welcome 🙂

@lekterable
Copy link
Contributor

I’d love to tackle this if you dont mind 🤗

@SimenB
Copy link
Member

SimenB commented Feb 1, 2019

Go for 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 12, 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.

4 participants