-
-
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
feat: return transformed code as a string, do not wrap in vm.Script
#9253
feat: return transformed code as a string, do not wrap in vm.Script
#9253
Conversation
ef1a97e
to
9289c94
Compare
We could ditch the wrapping in EDIT: Currently doing this, and it's way cleaner. Probably something I should have done when |
This reverts commit 6639ee3.
56ebbf7
to
4965e77
Compare
vm.Script
@thymikee I've moved the entire wrapping into |
|
||
scriptTransformer.transform('/fruits/banana.js', { | ||
// to make sure jest isn't declared twice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was broken anyways - if we declared it and then removed it here, we would still inject it from jest-runtime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely
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
Extracted from #9252. Since
jest-runtime
is the one injecting arguments into the module wrapper, it should also say which arguments those are. This makes@jest/transform
less coupled to the module wrapper, and thus to Jest's use case. It's marked as a breaking change since it changes@jest/transform
's interface, but it's not a breaking change for users of Jest.Test plan
Added some tests