Skip to content

✨ Add Jest SWC workaround and module mapper helper #948

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

Merged
merged 3 commits into from
Jan 8, 2024

Conversation

jrolfs
Copy link
Collaborator

@jrolfs jrolfs commented Jan 8, 2024

  • Add the swc_mut_cjs_exports plugin to SWC configuration
    • In an effort to make the SWC-based Jest compilation as backward compatible as possible, add the swc_mut_cjs_exports plugin so that Jest spies work in all the places they used to work.
  • Copy ts-jest's pathsToModuleNameMapper helper so that's also available when using the default SWC build instead of ts-jest

@jrolfs jrolfs force-pushed the fix/jest-workaround branch 3 times, most recently from fd70b98 to 1c68621 Compare January 8, 2024 22:00
jrolfs added 2 commits January 8, 2024 14:03
In an effort to make the SWC-based Jest compilation as backward
compatible as possible, add the `swc_mut_cjs_exports` plugin so that
Jest spies work in all the places they used to work.

See: https://github.com/magic-akari/swc_mut_cjs_exports
@jrolfs jrolfs force-pushed the fix/jest-workaround branch from 1c68621 to 2b110bd Compare January 8, 2024 22:03
…able

This copies in the module name mapper helper from `ts-jest` so we can use that
whether we're using ts-jest or not.
@jrolfs jrolfs force-pushed the fix/jest-workaround branch from 2b110bd to ab6f8cd Compare January 8, 2024 22:12
@jrolfs jrolfs merged commit 4b58aae into next Jan 8, 2024
@jrolfs jrolfs deleted the fix/jest-workaround branch January 8, 2024 22:27
Copy link

github-actions bot commented Jan 8, 2024

🎉 This PR is included in version 8.0.0-next.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant