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
Cannot mock virtual module inside test or describe [Bug]: #12568
Comments
@nihil-pro thanks for the report. could you provide a repro repo😀? |
Sure https://github.com/nihil-pro/test.git install dependencies and then run test |
The problem is the mock which inside the test is not hoisted to top the code, in other words, it's not hoisted before the Compiled result of
Compiled result of
|
@nihil-pro It's related to #2582. It seems |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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. |
Version
27.4.5
Steps to reproduce
When i try to mock a module that is virtual (using webpack module federation), it works only on top level.
this works well
this doesn't with error Cannot find module 'SomeModule'
Expected behavior
This should work fine
Actual behavior
Test suit filed to run
Cannot find module
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: