Fix requireActual fail with moduleNameMapper#8210
Conversation
4558bff to
0918cc1
Compare
Codecov Report
@@ Coverage Diff @@
## master #8210 +/- ##
==========================================
+ Coverage 62.29% 62.34% +0.04%
==========================================
Files 265 265
Lines 10551 10551
Branches 2563 2564 +1
==========================================
+ Hits 6573 6578 +5
+ Misses 3388 3385 -3
+ Partials 590 588 -2
Continue to review full report at Codecov.
|
SimenB
left a comment
There was a problem hiding this comment.
Thanks for the PR! I think this makes sense :)
There was a problem hiding this comment.
Looks good! It also doesn't seem to cause measurable performance impact (cold & warm cache) for a non-mapped test suite as we have in src/packages/*.
Would like @scotthovestadt to also have a look
@levinqdl mind resolving the conflicts?
1c63982 to
883773e
Compare
|
Hi @thymikee, conflicts have been resolved. |
|
Ok, merging. Thanks you so much @levinqdl! Looking forward to future contributions :) |
|
This just broke quite a lot of our tests, so I came here to complain but then realized that we relied on a buggy implementation and that I misread the docs. Fixed our setup and needed to leave this comment. |
* Remove the need to import built versions of packages in integration tests using jest's moduleNameMapper option * Upgrade jest with bugfix: jestjs/jest#8210 * prettify
|
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 PR fixes #7981 , requireActual not work with moduleNameMapper, witch currently throws an error.
This PR make
jest-resolveresolveModuleinvokeresolveStubModuleName, which resolves module with moduleNameMapper.resolveStubModuleNameis invoked beforeresolveModuleFromDirIfExists, so that moduleNameMapper config can override default behavior.Test plan
Test requireActual with a moduleNameMapper configuration, and it should resolve the module successfully.