-
-
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
[Feature]: Allow regular node dynamic import calls from jest test files #12439
Comments
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. |
@perrin4869 I'd use https://github.com/nicolo-ribaudo/jest-light-runner. You can use a separate project for just that one file if you want: https://jestjs.io/docs/configuration#projects-arraystring--projectconfig I don't think Jest itself should support this |
@SimenB Thanks! Yes, I noticed |
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. |
🚀 Feature Proposal
Allow calls to
import
such that they aren't routed through jest's implementation. Maybe provide an unmocked alias such asunmockedImport("./mymodule.js")
.Motivation
The motivation is to be able to have tests of the
package.json
exports
field within libraries and prevent exports in node environments from breaking.An example where this would be useful is in this PR which I abandoned momentarily due to this missing feature.
Example
No response
Pitch
Sorry for spamming on issue #9771
You suggested that one solution would be to have a separate, regular node script to achieve this kind of test, which is something that I had actually considered myself when I was putting together the PR, but I didn't pursue this approach for a number of reasons:
jest
is underway and maybe this would be supported in the new versionexec("node ./mytest.js")
from within the scripts file or modifying thepackage.json
test
script to read something like"test": "jest && node ./my-separate-test.js"
.jest
implementation is not desirable.Ultimately I was just wondering if this is a
won't fix
kind of feature, or something you are planning to add?Thank you for all your hard work on this module!
The text was updated successfully, but these errors were encountered: