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

Support monorepo #1343

Closed
ahnpnl opened this issue Jan 12, 2020 · 5 comments · Fixed by #2547
Closed

Support monorepo #1343

ahnpnl opened this issue Jan 12, 2020 · 5 comments · Fixed by #2547

Comments

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jan 12, 2020

Issue :

At the moment, ts-jest doesn't support well monorepo (typescript composite, yarn workspace, lerna etc..). This issue contains all related issues to monorepo:

#1341 : Cannot use rootMode upward for babel config (fixed via #1370)
#1336 : Error Unable to require d.ts for yarn workspace and typescript composite. (fixed via #1385)
#1333: Use wrong version of typescript in yarn workspace (fixed via #1377)
#1277 : Cannot collect coverage with custom compiler e.g ttypescript for lerna workspace.
#1134 : Compatibility with yarn workspaces pnp
#1109 : Cannot import mixin in yarn workspace and typescript compsite

Expected behavior :

Support monorepo out of the box or at least for common ones like yarn workspace, typescript composite, lerna.

Minimal repo :

Example repos are in those above issues

Problem

At the moment ts-jest is lack of helps. We would need community's help in tackling this issue. Feel free to contribute PRs if you have good ideas related to this issue.

cc @kulshekhar

@kulshekhar
Copy link
Owner

It would be good to add this support. That said, I personally only use ts-jest actively in non-monorepos so this will need help from others (the code and the related tests)

@arvigeus
Copy link

#1341 is related too - I got it when trying to setup a monorepo.

AArnott added a commit to AArnott/cloudbuild-task that referenced this issue Feb 3, 2020
AArnott added a commit to AArnott/cloudbuild-task that referenced this issue Feb 3, 2020
AArnott added a commit to AArnott/cloudbuild-task that referenced this issue Feb 3, 2020
@ahnpnl ahnpnl unpinned this issue Apr 14, 2020
@ahnpnl ahnpnl changed the title [Feature request]: Support monorepo Support monorepo May 5, 2020
@quadgod
Copy link

quadgod commented May 21, 2020

🐛 ;)))

  • Not working coverage collection for symbolic links.
  • Typescript setup not working with symbolic links but JS works.

To Reproduce

I made example project: https://github.com/nomadzetetic/monorepo.
Project contains 2 folders: /account and /shared. /account/src/shared -> symbolic link to /shared folder.

Steps to reproduce the behavior:

  1. Pull this example project https://github.com/nomadzetetic/monorepo
  2. cd account
  3. npm install
  4. npm run test

Expected behavior

In coverage report should be files from account/src/shared.

Link to repl or repo (highly encouraged)

repl.it demo

envinfo

System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  Binaries:
    Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
    Yarn: 1.21.1 - ~/.yarn/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v12.13.0/bin/npm
  npmPackages:
    jest: ^26.0.1 => 26.0.1 

@ahnpnl
Copy link
Collaborator Author

ahnpnl commented May 21, 2020

@quadgod coverage collection isn’t taken care by ts-jest. We would solve only the 2nd issue which is about TypeScript

@octogonz
Copy link

Heft is an interesting alternative for integrating Jest+TypeScript in a monorepo scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants