Uh oh!
There was an error while loading. Please reload this page.
Enable src/node_modules - #1081
Conversation
facebook-github-bot
commented
Nov 21, 2016
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
facebook-github-bot
commented
Nov 21, 2016
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
julien-f
commented
Dec 1, 2016
I also love putting application-wide packages in a
I find it sad that we have to find other, more complex solution, while the existing resolution algorithm is enough :/ |
gaearon
commented
Dec 1, 2016
What is the resolution now that jestjs/jest#2145 is closed? |
This is becoming sort of critical because we want to remove |
julien-f
commented
Dec 1, 2016
As far as I can see, the issue as been closed as wontfix, not resolved :/ I also created an issue for this (jestjs/jest#1995) in which @cpojer answered me by saying that he would not oppose a fix but he does not have time to take care of it himself. |
gaearon
commented
Dec 1, 2016
I’m sure we can all persuade @cpojer. I can literally bug him all day until he agrees to merge a PR as he moved to the London office. But we need somebody willing to figure out the problem and the solution and submit said PR. |
cpojer
commented
Dec 1, 2016
I'll do anything for you Dan but I may ask you for a favor in the future. |
gaearon
commented
Dec 1, 2016
A day of work on a Jest issue of your choice? |
modernserf
commented
Dec 1, 2016
I updated the PR with the Also, I still have no idea how i'm supposed to write an automated test for this, or if there even are tests in create-react-app (?!) |
| haste: { | ||
| providesModuleNodeModules: [".*"], | ||
| }, | ||
| }; |
There was a problem hiding this comment.
It's sort of unfortunate that this will end up in config after ejecting.
(@cpojer do we have better options?)
gaearon
commented
Dec 1, 2016
No, we only do artisan tests. On a serious note, if Travis passes it means that a basic project runs webpack and jest correctly without crashing, but you can't automatically test a particular feature right now. |
shanewilson
commented
Dec 1, 2016
Hey @gaearon@cpojer@modernserf, I've been working on a monorepo build tool that works with yarn and supports app-level modules under https://github.com/knitjs/knit/tree/master/modules/node_modules/%40knit/jest-config-socks |
cpojer
commented
Dec 2, 2016
To give a quick overview:
Let me know if you need anything else. |
modernserf
commented
Dec 9, 2016
@cpojer just got some time to work on this again. I have some changes in jest that work for create-react-app but have a failing test and I don't understand Jest well enough to know why. Can you help me understand? |
robertvansteen
commented
Dec 13, 2016
How's the progress on this? I'd love to help because this is kind of a blocking issue for me now. |
modernserf
commented
Dec 13, 2016
@rovansteen get the tests passing on this: modernserf/jest@a687e26 |
gaearon
commented
Dec 13, 2016
@modernserf I think it's best to send a PR to start discussion for better visibility. |
Reanmachine
commented
Feb 3, 2017
Can I make a general inquiry about what's going on here? The best I can tell is that @modernserf took this under his wing but due to the way I guess what I'm asking is, with all the work around this being prefixed with "Don't work on this, it's being taken care of" but looking like we're stuck until someone (??) fixes There's been no activity for 22 days on any of the issues/pr's related to this. I'd love to try and help on the jest/haste-map side but being that it's new functionality required I don't think it's a great candidate for someone unfamiliar with the jest code base or not in-the-loop with their development goals. How can I help? Or should I transition my projects off the |
modernserf
commented
Feb 3, 2017
@Reanmachine the haste map thing will probably not be fixed per se -- I think the idea was that someone should add a testPathIgnorePatterns config option that actually works with |
gaearon
commented
Jan 8, 2018
Closing. I think we want to have good integration with Yarn Workspaces and/or Lerna instead. |
cecilemuller
commented
Jan 9, 2018
That's unfortunate as the whole point of the src/node_modules structure is to avoid additional config and dependencies by using the native node module resolution. |
gaearon
commented
Jan 9, 2018
I understand, but it's not the approach the ecosystem is embracing. |
[HOLD] not particularly useful without changes in Jest
Partially fixes#607
These are the necessary changes in react-scripts to allow code to live in
src/node_modulesand allow Jest to run tests in that directory.However, Jest cannot find these tests on its own -- all files in any
node_modulesare filtered out even before the file matching patterns are applied. See issue jestjs/jest#2145.Without changes in Jest, there are a few workarounds:
Import the package tests into a file that jest can find
Whitelist the directories you want to test with the
haste.providesModuleNodeModulesoptionThis is not the intended use for this option, but its used as a whitelist for the haste module resolution, and therefore Jest can find tests in these directories.
TODO