-
-
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
[Bug]: Code transformation regression in jest 28 #12750
Comments
On surface it looks like your transformer’s Hard to say more without a minimal reproduction. The link repo does not install for me. Cloning it and running |
Might be enough to change one line inside process(src) {
// console.log("Processing file: ", src);
const escapedSrc = src.replace(/`/g, "\\`").replace(/\$(?=\{.*?\})/g, "\\$");
- return `module.exports.default = \`${escapedSrc}\``;
+ return { code: `module.exports.default = \`${escapedSrc}\`` };
}, |
That's correct 🙂 It also works in older versions of jest, so safe to land that change while still remaining on whatever jest version you have already |
@mrazauskas perhaps we could include the path to the transformer that returns the wrong structure? We could also link to the upgrade guide in the error message |
Right. There are few more places where the link would be useful. I will do this. |
Yes, it works now. Thanks a lot for the help!
That sounds like a good idea - obviously I had not realized that it was our own transformer (as opposed to some jest internals) that needed to be changed. |
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
28.0.1
Steps to reproduce
jest
andbabel-jest
to 28.0.1 and addjest-environment-jsdom
npm run test
Expected behavior
The tests pass as they did with jest 27.
Actual behavior
I get several failures like this one:
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: