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 |
| expect(vm.Script.mock.calls[1][0]).toEqual(snapshot); | ||
|
|
||
| scriptTransformer.transform('/fruits/banana.js', { | ||
| // to make sure jest isn't declared twice |
There was a problem hiding this comment.
this was broken anyways - if we declared it and then removed it here, we would still inject it from jest-runtime
|
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-runtimeis the one injecting arguments into the module wrapper, it should also say which arguments those are. This makes@jest/transformless 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