fix: upgrade TypeScript to 5.7 with Jest ESM mocks#805
Open
fix: upgrade TypeScript to 5.7 with Jest ESM mocks#805
Conversation
Signed-off-by: remo-lab <remopanda7@gmail.com>
0631587 to
7969ece
Compare
Signed-off-by: remo-lab <remopanda7@gmail.com>
Contributor
Author
|
@EdwardMoyse , this time i have fixed all the ci failures. |
Contributor
Author
|
@EdwardMoyse shall i update anything on this pr? |
Collaborator
|
Apologies for not being responsive but I'm on a family holiday this week. I'll try to do a review when im home on Sunday. |
Contributor
Author
|
No worries at all , thanks for letting me know. Hope you're having a great holiday! |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #724
Summary
This PR upgrades TypeScript to 5.7 across the monorepo and fixes Jest failures caused by ESM-only dependencies when running under
ts-jest.Changes include:
~5.5.4to~5.7.0(root, phoenix-event-display, phoenix-ng)ts-jestto^29.3.4inphoenix-event-displaymoduleNameMappermocks for ESM-only dependencies that break Jest’s CommonJS pipeline on TS 5.6+All 345 tests pass (
28 + 56suites,170 + 175tests) withyarn test:ci.What was happening
With TypeScript 5.6+, Jest started failing due to
.mjsfiles from ESM-only packages such as:three/examples/jsmjsroot@angular/coreIn my previous attempt (#768), I tried adjusting
transformIgnorePatternsand consolidating TypeScript versions. That approach failed because:<rootDir>/node_modules/...did not match hoisted workspace dependenciesnode_moduleswere being transformed byts-jestts-jestcould no longer handle.mjsESM modules correctlyFix
Instead of trying to force
ts-jestto transform ESM modules, this PR mocks them usingmoduleNameMapper.Added mocks for:
three/examples/jsm/*WebGL-dependent modules not usable in jsdom anyway.
jsrootESM-only modules imported transitively but not directly used in tests.
@angular/coreOnly
EventEmitteris used; replaced with a lightweight publish/subscribe mock.This avoids ESM parsing entirely and makes the test setup independent of TypeScript/Jest internals.
Test Plan
yarn test:cipasses (all 345 tests)