-
-
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
Only ignore root /node_modules/ #1995
Comments
I tried setting |
I recommend using lerna: https://github.com/lerna/lerna You should be able to set |
I will be if I could keep this simple setup for now without add a dependency it would be nice :)
Does not seem to work :/ |
I tried using this branch and a getting this:
doesn't seem like this is related? I can't find these modules anywhere in the tree. |
These files come from the |
Can you provide a repro that I can |
|
Can you reproduce? |
Thanks. You are right, we actually filter out files in Otherwise I'd keep suggesting lerna. It's unlikely I'll be able to spend any time working on the fix myself :( |
Thanks for your time, I'll see what I can do :) |
It seems that "testPathIgnorePatterns": [
"<rootDir>/node_modules/"
] has no effect — tests in any node_modules subdirectory aren't found, or am I overlooking something? If indeed all node_modules are ignored despite the setting, shouldn't this issue be reopened? UPD: fixed the package.json snippet. |
I just hit this too. Lerna is out of the question (there are lighterweight ways too achieve monorepo) and I've not been able to work around the opinionated filtering of node_modules either. |
@mnichols I ended up having a node_modules_tests directory next to node_modules — not very good but the lesser evil. |
This really sucks. Just spent hours wondering why my tests weren't getting picked up. Used every possible combination of ignore pattern options etc. |
Very disappointed about this. I was going to get Jest going in a legacy application that heavily uses |
@Iamchristopher we're happy to review a PR that does this #1995 (comment) |
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. |
Do you want to request a feature or report a bug? feature (or help to configure ;) )
What is the current behavior?
All
node_modules/
directories are ignored.What is the expected behavior?
I would like to ignore only the root
node_modules/
directory.My project organization:
The ideas is to build generic-ish modules in
src/node_modules
.If a local packages become useful on its own I can publish it in its own package without having to change my code.
It is IMHO the best solution to achieve this kind of behavior by exploiting the locality rule of modules resolution, without having to use a hack like
NODE_PATH
(which is discouraged).Run Jest again with
--debug
and provide the full configuration it prints. Please mention your node and npm version and operating system.The text was updated successfully, but these errors were encountered: