Jest: setup{Files,FilesAfterEnv} included in coverage report

Created on 30 Jan 2019  路  4Comments  路  Source: facebook/jest

馃悰 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
Bug Help Wanted

Most helpful comment

I鈥檇 love to tackle this if you dont mind 馃

All 4 comments

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?

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

I鈥檇 love to tackle this if you dont mind 馃

Go for it! 馃檪

Was this page helpful?
0 / 5 - 0 ratings