Skip to content

demonstrate changes to get esm graphql-js working with jest => use @swc/jest #8083

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

Closed
wants to merge 2 commits into from

Conversation

yaacovCR
Copy link

strategy: substitute @swc/jest for ts-jest

(A) globally: substitute "ts-jest" with "@swc/jest" in the jest config base file

(B) in package using an esm dependency such as graphql canary, override the default transformIgnorePatterns with an exception for our package of interest

@swc/jest drops type checking, but that seems to be taken care of anyway in the pretest script. @swc/jest is also faster!

compare with #8082

yaacovCR added 2 commits June 20, 2025 00:51
strategy: substitute @swc/jest for ts-jest

(A) globally: substitute "ts-jest" with "@swc/jest" in the jest config base file

(B) in package using an esm dependency such as graphql canary, override the default transformIgnorePatterns with an exception for our package of interest
@apollo-librarian
Copy link

apollo-librarian bot commented Jun 20, 2025

❌ Docs preview failed

The preview failed to build.

Build ID: c10cc212174e07286347db1c

Errors

General: Failed to fetch GitHub source: OK

@glasser
Copy link
Member

glasser commented Jul 3, 2025

Thanks Yaacov. I think this still does show that it takes work and refactoring to make Jest work with ESM, even with modern Node. (Though they actually just put out Jest v30 — I wonder if that helps at all.)

(Closing PR since this was more of a demo.)

@yaacovCR
Copy link
Author

yaacovCR commented Jul 4, 2025

In my testing, version 30 does not change anything around esm dependencies of a cjs project, may help with an actual esm project.

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