Skip to content
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

[jest-plugin] Use transformer config options #663

Closed
wants to merge 2 commits into from

Conversation

stagas
Copy link

@stagas stagas commented Nov 4, 2021

This PR adds the functionality for the jest plugin transformer to use transformer configuration options defined in jest.config.

In short, this works now:

module.exports = {
  ...
  transform: {
    "\\.(js|jsx|ts|tsx)$": [
      "@sucrase/jest-plugin",
      { jsxPragma: "h", jsxFragment: "Fragment" }
    ],
  ...
}

Notes

Tests are not included as I couldn't find where to put them.

Manually I tested both cases of passing and not passing a config. In the latter case Jest simply sends an empty object {} so the spread operation must be safe.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@alangpierce
Copy link
Owner

Sorry for not getting to this originally! This was also implemented very similarly in #749, which was just merged, so I'll close this PR and also mention this PR as well in the release notes.

@alangpierce alangpierce closed this Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants