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

Compatibility with yarn workspaces pnp #1134

Closed
Downchuck opened this issue Jun 21, 2019 · 3 comments
Closed

Compatibility with yarn workspaces pnp #1134

Downchuck opened this issue Jun 21, 2019 · 3 comments

Comments

@Downchuck
Copy link

Downchuck commented Jun 21, 2019

Jest has added compatibility to resolve yarn pnp projects, but it seems ts-jest is not compatible as it is unable to find typescript. This can be worked around for now by just disabling pnp: yarn install --disable-pnp

perhaps needs https://github.com/arcanis/ts-pnp

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jan 12, 2020

Close as duplicate #1333 and related to monorepo support in #1336

@ahnpnl
Copy link
Collaborator

ahnpnl commented Feb 7, 2020

ts-jest doesn't use compiler host, are there any ways else to tackle this ?

@darioblanco
Copy link

I don't know for sure if it is 100% related to this issue, but I managed to run ts-jest in a monorepo-based yarn2 PnP project.

Steps:

  • Do not use moduleNameMapper as stated in the migration guide. I instead use the link protocol in package.json, linking the package to "itself".
  • Do not use the preset config in Jest. Instead, I have used transform directly like this:
  transform: {
    '.(ts|tsx)': require.resolve('ts-jest'),
  },

Besides the ts-jest[config] (WARN) Unable to find the root of the project where ts-jest has been installed., everything seems to work now for a basic project.

I use ts-node 8.5.4 and jest 25.1.0

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

No branches or pull requests

3 participants