-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
transformIgnorePatterns won't exclude symlinked modules #5108
Comments
Can you try this with the stable jest 22? There have been symlink fixes there. If it still fails, can you create a repository with your repro? It's a bit easier to work with. Thanks! |
Hey, jest 22 does not solve this issue. I've created repo to reproduce and steps are inside : https://github.com/jony89/jest-symlinked-pkgs-repro |
@SimenB can you give some pointers on what areas of the codebase I should look at if I wanted to fix this? I've used Jest, but I've never dug into its internals. |
I can start dig into this also with some guidance ? |
My guess is that the error is somehow in here: https://github.com/facebook/jest/blob/c12bce6595b08626b8654f3ddb50a58d33071f0c/packages/jest-runtime/src/script_transformer.js#L489-L507 |
I've debugged it and the code was correct. It seems that pkg2 must hold .babelrc as well in order to be transformed with babel. after adding .babelrc to pkg2 it works well, seems like the correct behavior(?) |
I'm still experiencing this issue. pkg1 and pkg2 both have a .babelrc at the root. I also have this in my jest pkg1 jest config:
pkg2 will not compile, though.
|
Found my solution in #6229. I'm using Babel 7 and that has an impact on things. |
I just ran into this issue with symlinks, and found that the issue was my babel config from my current directory didn't apply to the symlinked directory (because the file is passed to babel with its "real" path not its symlinked path) Placing a copy of my .babelrc (Babel 6) beneath node_modules in the directory it was being symlinked from resolved the issue. So I think the fix here is to pass the local path to babel and not expand the symlink. |
@benmccormick It's been long time since your previous answer. Did you upgrade to use Babel 7 now? If yes, how did you tackle the symlink problem? Thanks. |
@gmichaeljaison I've switched jobs since then and don't really remember how this played out, sorry. |
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. |
What is the current behavior?
While trying to ignore
node_modules
except modules that are symlinked, jest or babel-jest won't transpile this modules as well.** steps to reproduce **
I've created repo to reproduce and steps are inside : https://github.com/jony89/jest-symlinked-pkgs-repro
import...
)use the following jest.config.js in pkg1 :
and add the .babelrc file
** steps to reproduce **
just try to run jest for any simple test that uses these to pkgs
What is the expected behavior?
pkg2 should be transpiled
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
npm : 5.5.1
node : 8.4.1
jest : 21.3.0-beta.10
The text was updated successfully, but these errors were encountered: