-
-
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
add globalMocks, remove mocksPattern #2705
Conversation
Generated by 🚫 dangerJS |
Codecov Report@@ Coverage Diff @@
## master #2705 +/- ##
==========================================
+ Coverage 67.9% 67.98% +0.08%
==========================================
Files 140 140
Lines 5057 5067 +10
==========================================
+ Hits 3434 3445 +11
+ Misses 1623 1622 -1
Continue to review full report at Codecov.
|
This is fantastic. Thanks for doing this. I honestly don't think it's that big of a deal! Here are two suggestions that I think we should do to take it over the finish line:
|
Finally, I believe at Facebook we will need to keep allowing all mocks that are currently in the system. Can you think of a way to make it so it can work the same way as it did before? Otherwise we'd have to add hundreds of folders to this config at Facebook. |
In case hashmaps structures are used for local mocks too, of course... but they are not :) so it's relatively easy
You're right. Checked against jest tests and our projects tests
what about |
@cpojer ready to check again. I've added a special undocumented value to force every mock as global:
which internally gets translated to AFAIK It's not possible to use |
That's right, you can have just one type for user provided config in |
Hi, I notice it's been two months since this was touched.
Does this PR solve this bug, or has there been another solution in the meantime? Thanks for all your work @ColCh, and appreciating the clear, kind and constructive way you host this community @cpojer 🥇 |
Ok, I think we need to find a different solution to this and we should be looking at it, but haven't had enough time recently to do so. I'll close this PR for now because it is quite outdated at this point. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
this is a temporary solution - it's a LOT OF things to be done to adapt "HasteMaps" data structures to understand conception of local/global mocks
but it solves duplicate mock error:
I've implemented thing discussed here
#2070 (comment)
#2070 (comment)
Test plan
yarn test
yarn link
). Duplicate mock warning is gone, all our tests have passed. We have mocks for app modules as well as mocks for node_modulesmerging this PR should close #2070