Skip to content

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2025
@yaacovCR yaacovCR deleted the test-esm-swc branch August 18, 2025 01:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants