This repository was archived by the owner on May 28, 2026. It is now read-only.
Conversation
uuid 12+ ships ESM-only, so Jest can no longer require() it directly. Extend the ts-jest transform to handle .js files and allow uuid's ESM through transformIgnorePatterns. Supersedes mozilla-services#170 and mozilla-services#157.
Contributor
Author
|
Superseded by #170, which now includes the Jest config fix as a follow-up commit. Closing in favor of that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uuid11.1.0 → 14.0.0 and@hey-api/client-fetch0.12.0 → 0.13.1 — the same prod-deps that dependabot proposed in chore(deps): bump the production-dependencies group across 1 directory with 2 updates #157 and chore(deps): bump uuid from 11.1.0 to 14.0.0 #170.Why the jest change is needed
uuid v12 dropped its CommonJS build. With the old config, ts-jest would only transform
.ts/.tsx, and Jest's defaulttransformIgnorePatternsignores all ofnode_modules/. So when a test importeduuid, Jest tried torequire()ESM and choked onexport { … }.The fix:
.jsfiles usingts-jestwithallowJs: trueandmodule: commonjs.uuidfromtransformIgnorePatternsso its ESM gets transformed for the test environment.The project's own source is
.ts/.tsxso the new JS transform only kicks in for the uuid files exempted fromtransformIgnorePatterns.Supersedes
Test plan
npm test— 20/20 suites pass, 102/102 tests pass, 100% statement coveragenpm run lint— cleannpm run build— succeeds, validates dist