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

babel-jest transforming dependencies #2034

Closed
chrislloyd opened this issue Oct 31, 2016 · 3 comments
Closed

babel-jest transforming dependencies #2034

chrislloyd opened this issue Oct 31, 2016 · 3 comments

Comments

@chrislloyd
Copy link

Do you want to request a feature or report a bug?

Feature

What is the current behavior?

babel-jest doesn't transform package dependencies.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal repository on GitHub that we can npm install and npm test.

We have a Lerna repo where one package depends on another. Jest will compile the immediate package, but skip compiling dependencies. This inevitably leads to errors like:

import Element from './element'
    ^^^^^^
    SyntaxError: Unexpected token import

What is the expected behavior?

It just works I guess? Not 100% sure of what the preferred fix would be.

@cpojer
Copy link
Member

cpojer commented Nov 1, 2016

You can adjust preprocessorIgnorePatterns to also transform node_modules. The problem with that is that the initial run of Jest is going to be a lot slower, which is why it isn't a default.

In Jest itself, this isn't a problem (we also use lerna): with npm run watch we continuously compile changes and every package's package.json points to build/index.js instead of src/index.js. This works really well – I suggest using the same kind of setup we have in this repo :)

@cpojer cpojer closed this as completed Nov 1, 2016
@chrislloyd
Copy link
Author

Awesome, thanks for the reply — appreciate the insight.

On Mon, Oct 31, 2016 at 6:47 PM Christoph Pojer notifications@github.com
wrote:

You can adjust preprocessorIgnorePatterns to also transform node_modules.
The problem with that is that the initial run of Jest is going to be a lot
slower, which is why it isn't a default.

In Jest itself, this isn't a problem (we also use lerna): with npm run
watch we continuously compile changes and every package's package.json
points to build/index.js instead of src/index.js. This works really well
– I suggest using the same kind of setup we have in this repo :)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#2034 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAACzmH-ujemQFDDewWN6H2GX0HbjHK3ks5q5podgaJpZM4Klior
.

@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 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants