[]: Replace ts-jest and jasmine2 with @swc/jest and jest-circus#177
Draft
samuelreichert wants to merge 4 commits into
Draft
[]: Replace ts-jest and jasmine2 with @swc/jest and jest-circus#177samuelreichert wants to merge 4 commits into
samuelreichert wants to merge 4 commits into
Conversation
Switch Jest transform from ts-jest to @swc/jest (3-5x faster, Rust-native, no type-checking overhead) and runner from jest-jasmine2 to jest-circus (default since Jest 27, better errors, supports retryTimes). Add explicit testTimeout of 10000ms. Drop separate jsx transform — @swc/jest handles both .ts and .js extensions via unified pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Checklist
[XX-000]: description)? ✅ ❌This PR contains
What is the purpose of this PR?
What
Swap the Jest transform and runner in
@mendix/pluggable-widgets-tools's shared test config.test-config/jest.config.jsts-jest→@swc/jest(unified(t|j)sx?pattern replaces two separate rules)jest-jasmine2→jest-circus/runnertestTimeout: 10000package.json@swc/core ^1.10.0,@swc/jest ^0.2.37Why
ts-jestis slow. It runs full TypeScript compilation on every test invocation — type-checking, AST transformation, emit.@swc/jestis a Rust-native transpiler. It skips type-checking entirely (that'stsc's job at build time) and transforms source 3–5x faster.jest-jasmine2is legacy. Jest replaced it withjest-circusas the default runner in Jest 27. Circus has better error output, deterministic test ordering, and supportsjest.retryTimes(). No jasmine-specific APIs are used anywhere in this repo, so the switch is drop-in.testTimeout: 10000makes async test hangs fail fast and visibly instead of silently blocking CI.SWC config notes
jsc.targetes2019ts-jesttarget: "ES2019"jsc.parsertypescript,tsx: true,decorators: truemodule.typecommonjsts-jestmodule: "commonjs", protects against any package with"type": "module"jsc.transform.react.runtimeautomaticimport Reactneeded in JSX filesPerformance
PWT's own tests are pure TypeScript utilities with no TSX or React transforms, so they don't exercise the hot path where
@swc/jestwins. Consumers with TSX-heavy test suites will see the 3–5× improvement.All 79 existing PWT unit tests pass after the change.
Downstream impact
All consumers of this package get the speedup automatically on the next version bump — zero changes required on their end.