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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

collectCoverageFrom ignored in monorepo #8207

Closed
RuneKR opened this issue Mar 25, 2019 · 9 comments
Closed

collectCoverageFrom ignored in monorepo #8207

RuneKR opened this issue Mar 25, 2019 · 9 comments

Comments

@RuneKR
Copy link

RuneKR commented Mar 25, 2019

馃悰 Bug Report

Migrating from v23 to v24 of jest i have noticed that collectCoverageFrom stopped working for my mono repo.

To Reproduce

Please follow steps in example: https://github.com/RuneKR/bad-performance/tree/fix/jest

Expected behavior

Cover coverage would be collected

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS High Sierra 10.13.6
    CPU: (4) x64 Intel(R) Core(TM) i5-2500S CPU @ 2.70GHz
  Binaries:
    Node: 8.11.1 - /usr/local/bin/node
    npm: 6.6.0 - /usr/local/bin/npm
  npmPackages:
    jest: ^24.5.0 => 24.5.0 
@RuneKR RuneKR changed the title collectCoverageFrom ignored collectCoverageFrom ignored in monorepo Mar 28, 2019
@iturgeon
Copy link

iturgeon commented Apr 9, 2019

I can reproduce this. Discovered after adding a new file to a monorepo that I expected to break coverage, but it didn't.

I created a test case repo to reproduce: https://github.com/iturgeon/jest-collect-coverage-monorepo

npx: installed 1 in 2.578s

  System:
    OS: macOS 10.14.3
    CPU: (8) x64 Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
  Binaries:
    Node: 10.4.1 - ~/.nvm/versions/node/v10.4.1/bin/node
    Yarn: 1.13.0 - ~/.nvm/versions/node/v10.4.1/bin/yarn
    npm: 6.1.0 - ~/.nvm/versions/node/v10.4.1/bin/npm

@aaronleesmith
Copy link

Any update on this? Monorepo support from Jest has been terrible for us, this is one more issue to get around.

@RuneKR
Copy link
Author

RuneKR commented Jul 24, 2019

I did seem to find an alternative way of setting up the project that allowed us to collect the coverage. Only thing is that jest has quite a slow performance in a monorepo setup.

Give this thread a comment and i will upload the example

@kachkaev
Copy link
Contributor

kachkaev commented Oct 3, 2019

@RuneKR could you please share your solution? We also struggle with jest in a monorepo project 馃槥

@RuneKR
Copy link
Author

RuneKR commented Oct 13, 2019

Hi,

This is the workaround: https://github.com/RuneKR/bad-performance/tree/fix/test-coverage

It only works if you tests from at least one package for some reason. I really need to deep dive for a proper fix.

@MichalLytek
Copy link

Needs Repro (label)

I can give another example of repo to reproduce:
https://github.com/MichalLytek/type-graphql/tree/6afc3d7a3e6df8abb0b881c7961ae862601fa00e

git clone
npm i
npm bootstrap
npx jest --coverage
cd packages/core
npx jest --coverage (it will fail to compile on coverage, check only the coverage table entries)

The workaround of using coverage on seperate folders currently doesn't work with ts-jest 馃槥

I am willing to help if one of the maintainer will point the places to dig 馃槈

@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 19, 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

6 participants