-
Notifications
You must be signed in to change notification settings - Fork 466
revert 29.4.3 changes #5050
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
revert 29.4.3 changes #5050
Conversation
WalkthroughReplaced the ts-jest “transpilation” option with TypeScript’s “isolatedModules” across configs, tests, and docs. Added isolated tsconfig variants. Updated example scripts/configs to “isolated” equivalents. Adjusted compiler warning gating to read isolatedModules from initial TS options. Revised messages, types, and tests accordingly. Removed obsolete transpiler configs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Jest
participant TsJest as ts-jest Transformer
participant TsCompiler
participant TS as TypeScript
Jest->>TsJest: transform(file, jestConfig)
TsJest->>TsCompiler: getCompiledOutput(file, initialTsOptions)
alt module in {Node16, NodeNext, Node18} AND isolatedModules is false
TsCompiler-->>TsJest: warn(Helps.UsingModernNodeResolution)
end
TsCompiler->>TS: transpileModule(file, { isolatedModules })
TS-->>TsCompiler: { outputText, sourceMapText, diagnostics }
TsCompiler-->>TsJest: compiled output
TsJest-->>Jest: transformed code
sequenceDiagram
autonumber
participant UserConfig as ts-jest Options
participant ConfigSet
participant FS as FileSystem
participant Logger
UserConfig->>ConfigSet: load(options)
alt options.isolatedModules provided
ConfigSet->>ConfigSet: parsedTsConfig.options.isolatedModules = true
ConfigSet->>FS: check tsconfigFilePath exists?
alt path exists
ConfigSet->>Logger: deprecate(IsolatedModulesWithTsconfigPath{tsconfigFilePath})
else no path
ConfigSet->>Logger: deprecate(IsolatedModulesWithoutTsconfigPath)
end
end
ConfigSet-->>UserConfig: resolved settings
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 10
🧹 Nitpick comments (20)
website/versioned_docs/version-29.4/getting-started/options/isolatedModules.md (2)
12-13: Nit: grammar tweak“what TypeScript calls” → “which TypeScript calls”.
-But it can also be used to compile each file separately, what TypeScript calls an 'isolated module'. +But it can also be used to compile each file separately, which TypeScript calls an 'isolated module'.
43-43: Nit: wording“comparing to” → “compared to”.
-Using `isolatedModules: false` comes with a cost of performance comparing to `isolatedModules: true`. There is a way +Using `isolatedModules: false` comes with a performance cost compared to `isolatedModules: true`. There is a waysrc/types.ts (1)
80-87: Clarify behavior in JSDocMake it explicit that
trueswitches tots.transpileModule(no type-checking).- * Compiles files as isolated modules (disables some features) + * Compiles files as isolated modules (disables some features). When `true`, ts-jest uses TypeScript's `transpileModule` path (no type-checking).website/docs/getting-started/options/isolatedModules.md (2)
12-13: Nit: grammar tweakSame as versioned doc: “what TypeScript calls” → “which TypeScript calls”.
-But it can also be used to compile each file separately, what TypeScript calls an 'isolated module'. +But it can also be used to compile each file separately, which TypeScript calls an 'isolated module'.
43-43: Nit: wording“comparing to” → “compared to”.
-Using `isolatedModules: false` comes with a cost of performance comparing to `isolatedModules: true`. There is a way +Using `isolatedModules: false` comes with a performance cost compared to `isolatedModules: true`. There is a waysrc/utils/messages.ts (1)
31-32: Nit: clarify Node kinds in help textSpell out the names and use “with” instead of “in” for readability.
- UsingModernNodeResolution = 'Using hybrid module kind (Node16/18/Next) is only supported in "isolatedModules: true". Please set "isolatedModules: true" in your tsconfig.json.', + UsingModernNodeResolution = 'Using hybrid module kind (Node16, Node18, or NodeNext) is only supported with "isolatedModules: true". Please set "isolatedModules: true" in your tsconfig.json.',e2e/esm-features/jest-transpiler-esm.config.ts (1)
4-12: Rename displayName — "transpiler" is misleading for an isolated-modules setupVerified e2e/esm-features/tsconfig-esm-transpiler.spec.json sets "isolatedModules": true; update displayName in e2e/esm-features/jest-transpiler-esm.config.ts.
- displayName: 'esm-features-transpiler-esm', + displayName: 'esm-features-esm-isolated',e2e/transformer-in-ts/tsconfig-cjs-transpiler.spec.json (1)
1-6: Name consistency nit: consider “-isolated” suffix.
The file enables isolatedModules; naming it “...-isolated.spec.json” would align with other additions.e2e/enum/tsconfig-cjs-transpiler.spec.json (1)
1-6: LGTM — optional: extract sharedisolatedModulestsconfig
Many e2e//tsconfig--transpiler.spec.json files set "isolatedModules": true; consider extracting that into a shared base tsconfig to remove duplication if it doesn't hurt test clarity.e2e/source-map/jest-transpiler-cjs.config.ts (1)
9-10: Path swap to tsconfig-cjs-transpiler.spec.json is fine; ensure source maps are enabled upstream.This suite relies on accurate source maps; confirm the base/extended tsconfig sets sourceMap: true.
If not already, set sourceMap: true in the extended chain used by this config.
e2e/extend-ts-jest/jest-transpiler-esm.config.ts (1)
10-12: ESM transpiler config: consider limiting to TS or enable allowJsUsing TS_JS_TRANSFORM_PATTERN will transform .js as well. If not required here, prefer TS_TRANSFORM_PATTERN to reduce surface area; otherwise ensure the tsconfig enables allowJs.
- import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest' + import { type JestConfigWithTsJest, TS_TRANSFORM_PATTERN } from 'ts-jest' ... - [TS_JS_TRANSFORM_PATTERN]: [ + [TS_TRANSFORM_PATTERN]: [e2e/hoist-jest/jest-transpiler-cjs.config.ts (1)
9-10: CJS hoist config: good; optional tightening of transform patternChange looks good. If JS transformation isn’t needed in this suite, consider TS_TRANSFORM_PATTERN; otherwise ensure allowJs in the tsconfig.
- import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest' + import { type JestConfigWithTsJest, TS_TRANSFORM_PATTERN } from 'ts-jest' ... - [TS_JS_TRANSFORM_PATTERN]: [ + [TS_TRANSFORM_PATTERN]: [examples/react-app/jest-isolated.config.ts (1)
5-6: Use for consistency across configs.Optional, but using absolute-from-rootDir paths avoids cwd surprises.
- tsconfig: 'tsconfig-isolated.spec.json', + tsconfig: '<rootDir>/tsconfig-isolated.spec.json',examples/ts-only/jest-esm-isolated.config.ts (1)
7-8: LGTM; standardize tsconfig path if desired.Config is correct; consider prefixing with for consistency with other example/e2e files.
- tsconfig: 'tsconfig-esm-isolated.json', + tsconfig: '<rootDir>/tsconfig-esm-isolated.json',examples/js-with-ts/jest-isolated.config.ts (1)
7-8: Preset switch to tsconfig is correct; consider for path stability.Minor consistency nit only.
- tsconfig: 'tsconfig-isolated.json', + tsconfig: '<rootDir>/tsconfig-isolated.json',examples/js-with-babel/jest-isolated.config.ts (1)
7-9: isolatedModules is enabled — OK; optional: add to tsconfig path.examples/js-with-babel/tsconfig-isolated.json: compilerOptions.isolatedModules = true.
- tsconfig: 'tsconfig-isolated.json', + tsconfig: '<rootDir>/tsconfig-isolated.json',src/legacy/compiler/ts-compiler.ts (1)
196-199: Align isolatedModules source of truth with language-service gatingCtor uses the tsconfig-derived configSet.isolatedModules (set from parsedTsConfig.options.isolatedModules in src/legacy/config/config-set.ts), but this warning checks this._initialCompilerOptions.isolatedModules — that can produce inconsistent warnings vs behavior. Use the tsconfig-derived configSet value for both checks (change the condition in src/legacy/compiler/ts-compiler.ts around lines ~196–199 to use configSet.isolatedModules).
website/docs/getting-started/presets.md (1)
132-134: Typo in example.“optionsa” → “options”.
-const presetConfig = createDefaultLegacyPreset({ - //...optionsa -}) +const presetConfig = createDefaultLegacyPreset({ + //...options +})src/legacy/compiler/ts-compiler.spec.ts (1)
105-175: Add a regression test for setupFiles matcher extensions (issue #5049).To prove the revert, add an e2e that imports @testing-library/jest-dom in setupFiles and asserts matchers in a test without per‑file import. I can draft this if helpful.
website/versioned_docs/version-29.4/getting-started/options.md (1)
53-53: Fix option anchor to point back to transpilation page.Anchor should align with the reverted option name.
-[isolatedmodules]: options/isolatedModules +[transpilation]: options/transpilation
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (89)
e2e/const-enum/__tests__/const-enum.spec.ts(1 hunks)e2e/const-enum/jest-transpiler-cjs.config.ts(1 hunks)e2e/const-enum/jest-transpiler-esm.config.ts(1 hunks)e2e/const-enum/tsconfig-cjs-transpiler.spec.json(1 hunks)e2e/const-enum/tsconfig-esm-transpiler.spec.json(1 hunks)e2e/enum/jest-transpiler-cjs.config.ts(1 hunks)e2e/enum/jest-transpiler-esm.config.ts(1 hunks)e2e/enum/tsconfig-cjs-transpiler.spec.json(1 hunks)e2e/enum/tsconfig-esm-transpiler.spec.json(1 hunks)e2e/esm-features/jest-compiler-esm.config.ts(1 hunks)e2e/esm-features/jest-transpiler-esm.config.ts(1 hunks)e2e/esm-features/tsconfig-esm-transpiler.spec.json(1 hunks)e2e/extend-ts-jest/jest-transpiler-cjs.config.ts(1 hunks)e2e/extend-ts-jest/jest-transpiler-esm.config.ts(1 hunks)e2e/extend-ts-jest/tsconfig-cjs-transpiler.spec.json(1 hunks)e2e/extend-ts-jest/tsconfig-esm-transpiler.spec.json(1 hunks)e2e/hoist-jest/jest-transpiler-cjs.config.ts(1 hunks)e2e/hoist-jest/tsconfig-cjs-transpiler.spec.json(1 hunks)e2e/presets/jest-transpiler-cjs.config.ts(1 hunks)e2e/presets/jest-transpiler-esm.config.ts(1 hunks)e2e/presets/tsconfig-cjs-transpiler.spec.json(1 hunks)e2e/presets/tsconfig-esm-transpiler.spec.json(1 hunks)e2e/source-map/jest-transpiler-cjs.config.ts(1 hunks)e2e/source-map/jest-transpiler-esm.config.ts(1 hunks)e2e/source-map/tsconfig-cjs-transpiler.spec.json(1 hunks)e2e/source-map/tsconfig-esm-transpiler.spec.json(1 hunks)e2e/test-utils/jest-transpiler-cjs.config.ts(1 hunks)e2e/test-utils/jest-transpiler-esm.config.ts(1 hunks)e2e/test-utils/tsconfig-cjs-transpiler.spec.json(1 hunks)e2e/test-utils/tsconfig-esm-transpiler.spec.json(1 hunks)e2e/transform-js/jest-transpiler-cjs.config.ts(1 hunks)e2e/transform-js/jest-transpiler-esm.config.ts(1 hunks)e2e/transform-js/tsconfig-cjs-transpiler.spec.json(1 hunks)e2e/transform-js/tsconfig-esm-transpiler.spec.json(1 hunks)e2e/transformer-in-ts/jest-transpiler-cjs.config.ts(1 hunks)e2e/transformer-in-ts/jest-transpiler-esm.config.ts(1 hunks)e2e/transformer-in-ts/tsconfig-cjs-transpiler.spec.json(1 hunks)e2e/transformer-in-ts/tsconfig-esm-transpiler.spec.json(1 hunks)e2e/transformer-options/jest-transpiler-cjs.config.ts(1 hunks)e2e/transformer-options/jest-transpiler-esm.config.ts(1 hunks)e2e/transformer-options/tsconfig-cjs-transpiler.spec.json(1 hunks)e2e/transformer-options/tsconfig-esm-transpiler.spec.json(1 hunks)examples/js-with-babel/jest-esm-isolated.config.ts(1 hunks)examples/js-with-babel/jest-isolated.config.ts(1 hunks)examples/js-with-babel/package.json(1 hunks)examples/js-with-babel/tsconfig-esm-isolated.json(1 hunks)examples/js-with-babel/tsconfig-isolated.json(1 hunks)examples/js-with-ts/jest-esm-isolated.config.ts(1 hunks)examples/js-with-ts/jest-isolated.config.ts(1 hunks)examples/js-with-ts/package.json(1 hunks)examples/js-with-ts/tsconfig-esm-isolated.json(1 hunks)examples/js-with-ts/tsconfig-isolated.json(1 hunks)examples/monorepo-app/jest-esm-isolated.config.ts(1 hunks)examples/monorepo-app/jest-esm-transpiler.config.ts(0 hunks)examples/monorepo-app/jest-isolated.config.ts(1 hunks)examples/monorepo-app/jest-transpiler.config.ts(0 hunks)examples/monorepo-app/package.json(1 hunks)examples/monorepo-app/type-commonjs/jest-esm-isolated.config.ts(1 hunks)examples/monorepo-app/type-commonjs/jest-isolated.config.ts(1 hunks)examples/monorepo-app/type-commonjs/tsconfig-esm-isolated.json(1 hunks)examples/monorepo-app/type-commonjs/tsconfig-isolated.json(1 hunks)examples/monorepo-app/type-module/jest-esm-isolated.config.ts(1 hunks)examples/monorepo-app/type-module/jest-isolated.config.ts(1 hunks)examples/monorepo-app/type-module/tsconfig-esm-isolated.json(1 hunks)examples/monorepo-app/type-module/tsconfig-isolated.json(1 hunks)examples/package.json(1 hunks)examples/react-app/jest-esm-isolated.config.ts(1 hunks)examples/react-app/jest-isolated.config.ts(1 hunks)examples/react-app/package.json(1 hunks)examples/react-app/tsconfig-esm-isolated.spec.json(1 hunks)examples/react-app/tsconfig-isolated.spec.json(1 hunks)examples/ts-only/jest-esm-isolated.config.ts(1 hunks)examples/ts-only/jest-isolated.config.ts(1 hunks)examples/ts-only/package.json(1 hunks)examples/ts-only/tsconfig-esm-isolated.json(1 hunks)examples/ts-only/tsconfig-isolated.json(1 hunks)jest.config.ts(1 hunks)src/legacy/compiler/ts-compiler.spec.ts(3 hunks)src/legacy/compiler/ts-compiler.ts(1 hunks)src/legacy/config/config-set.spec.ts(3 hunks)src/legacy/config/config-set.ts(1 hunks)src/types.ts(1 hunks)src/utils/messages.ts(2 hunks)website/docs/getting-started/options.md(2 hunks)website/docs/getting-started/options/isolatedModules.md(3 hunks)website/docs/getting-started/presets.md(25 hunks)website/versioned_docs/version-29.4/getting-started/options.md(2 hunks)website/versioned_docs/version-29.4/getting-started/options/isolatedModules.md(3 hunks)website/versioned_docs/version-29.4/getting-started/presets.md(24 hunks)
💤 Files with no reviewable changes (2)
- examples/monorepo-app/jest-esm-transpiler.config.ts
- examples/monorepo-app/jest-transpiler.config.ts
🧰 Additional context used
🧬 Code graph analysis (4)
src/legacy/compiler/ts-compiler.ts (1)
src/transpilers/typescript/transpile-module.ts (1)
isModernNodeModuleKind(51-53)
src/legacy/config/config-set.ts (1)
src/utils/messages.ts (1)
interpolate(69-72)
src/legacy/config/config-set.spec.ts (2)
src/__helpers__/fakers.ts (1)
createConfigSet(42-74)src/utils/messages.ts (1)
interpolate(69-72)
src/legacy/compiler/ts-compiler.spec.ts (1)
src/__helpers__/fakers.ts (1)
makeCompiler(77-104)
🪛 Biome (2.1.2)
e2e/const-enum/tsconfig-cjs-transpiler.spec.json
[error] 5-5: Expected a property but instead found '}'.
Expected a property here.
(parse)
e2e/const-enum/tsconfig-esm-transpiler.spec.json
[error] 5-5: Expected a property but instead found '}'.
Expected a property here.
(parse)
🔇 Additional comments (68)
e2e/transformer-options/tsconfig-esm-transpiler.spec.json (1)
1-6: LGTM.Extends ESM spec tsconfig and enables
isolatedModules. No issues spotted.e2e/transform-js/tsconfig-cjs-transpiler.spec.json (1)
1-6: LGTM.CJS variant mirrors the ESM one; consistent with the pattern elsewhere.
examples/monorepo-app/type-module/tsconfig-isolated.json (1)
1-6: LGTM.Minimal isolated config extending the base; matches the new preset usage.
examples/js-with-ts/tsconfig-esm-isolated.json (1)
1-6: LGTM.ESM isolated tsconfig is well-formed and aligned with the preset change.
examples/js-with-ts/jest-esm-isolated.config.ts (1)
6-8: Confirmed tsconfig presence. File examples/js-with-ts/tsconfig-esm-isolated.json exists and should be picked up by the preset.examples/monorepo-app/jest-isolated.config.ts (1)
3-5: LGTM — project paths verified.
Both referenced configs exist at examples/monorepo-app/type-commonjs/jest-isolated.config.ts and examples/monorepo-app/type-module/jest-isolated.config.ts.jest.config.ts (1)
15-21: Revert intent vs. change direction: confirm.This adds
isolatedModules: true(and per PR removestranspilation: true) while the PR title says “revert 29.4.3 changes.” Confirm intended direction and that this actually fixes #5049 (setupFiles-added matchers visible in tests). If the intent is to revert, restore the pre-29.4.3 config (dropisolatedModules, reintroducetranspilation: true) or update the PR title/description.Verification summary: ran the suggested checks — found jest.config.ts uses
setupFilesAfterEnv: '<rootDir>/src/__helpers__/setup-jest.ts'and examples/*/setupTests.ts imports@testing-library/jest-dom. The searches for matcher usage (toBeInTheDocument,toHaveAttribute) andexpect.extendreturned no matches and ripgrep reported “No files were searched,” so the result is inconclusive.Action required: confirm intent (revert vs change) and either restore the old tsconfig options or update PR metadata. To validate the regression locally re-run matcher searches without type/ignore filters or run the test suite. Example check to run locally:
rg -nP 'toBeInTheDocument\(|toHaveAttribute\(|expect\.extend\(' -S --no-ignore -g '!/node_modules/'examples/monorepo-app/type-module/jest-isolated.config.ts (1)
7-7: Verify isolated tsconfig presence and ESM settings
- Confirmed: examples/monorepo-app/type-module/tsconfig-isolated.json exists and contains "isolatedModules": true (line 4).
- Missing: no match for "module": "NodeNext"|"ESNext" or "moduleResolution": "NodeNext"|"Bundler" — ensure one of these is set (and that package.json has "type": "module" if required) to guarantee ESM/NodeNext compatibility.
- Add a CI check that asserts the tsconfig file exists and contains the expected keys/values.
src/utils/messages.ts (1)
48-53: Deprecation messages: confirmed — old key removed, new messages wiredReplaceIsolatedModulesWithTranspilation not found; IsolatedModulesWithTsconfigPath and IsolatedModulesWithoutTsconfigPath are defined and referenced.
Locations: src/utils/messages.ts:48,51; src/legacy/config/config-set.ts:220,225; src/legacy/config/config-set.spec.ts:1171,1195.
website/docs/getting-started/options.md (1)
44-45: Link target verified — no action requiredUnversioned page website/docs/getting-started/options/isolatedModules.md exists and versioned copies (v28.0, v29.0, v29.2–29.4) are present; the [isolatedmodules] reference in getting-started/options.md resolves.
examples/package.json (1)
15-19: No changes required — example workspaces already include the scripts and configs. Verified each examples/* package.json defines test-isolated and test-esm-isolated, and corresponding jest-isolated.config.ts / jest-esm-isolated.config.ts files are present.src/types.ts (1)
80-87: Deprecation text looks good — precedence verifiedUsing the ts-jest option isolatedModules=true emits the deprecation warning (with or without a tsconfig path) and sets parsedTsConfig.options.isolatedModules = true; if the ts-jest option is not used, the tsconfig value is respected (this.isolatedModules = parsedTsConfig.options.isolatedModules ?? false).
See: src/legacy/config/config-set.ts (constructor: handling of options.isolatedModules), src/utils/messages.ts (Deprecations.IsolatedModulesWithTsconfigPath / IsolatedModulesWithoutTsconfigPath), src/legacy/config/config-set.spec.ts (tests asserting the warnings).
e2e/extend-ts-jest/tsconfig-cjs-transpiler.spec.json (1)
1-6: LGTM: isolated CJS tsconfig for extend-ts-jest e2e.
Confirmed reference in e2e/extend-ts-jest/jest-transpiler-cjs.config.ts:9.examples/js-with-babel/tsconfig-esm-isolated.json (1)
1-6: LGTM: isolatedModules override for ESM example is correct. Jest config and the npm test script reference the isolated tsconfig (examples/js-with-babel/jest-esm-isolated.config.ts and examples/js-with-babel/package.json); no behavioral risk.e2e/source-map/tsconfig-esm-transpiler.spec.json (1)
1-6: LGTM: isolated ESM tsconfig for source-map e2e.
Both E2E configs reference tsconfig-esm-transpiler.spec.json (e2e/esm-features/jest-compiler-esm.config.ts:10, e2e/source-map/jest-transpiler-esm.config.ts:10). Matches intended "transpiler" test path.examples/monorepo-app/type-commonjs/tsconfig-isolated.json (1)
1-6: LGTM: isolated override for CJS in monorepo app.
Jest references tsconfig-isolated.json at examples/monorepo-app/type-commonjs/jest-isolated.config.ts:7. Matches pattern used elsewhere.examples/monorepo-app/type-commonjs/tsconfig-esm-isolated.json (1)
1-6: ESM config under "type-commonjs" — referenced by test config; no action required.
examples/monorepo-app/type-commonjs/jest-esm-isolated.config.ts references tsconfig-esm-isolated.json (line 7).examples/ts-only/jest-isolated.config.ts (1)
6-8: Approve — tsconfig-based isolated setup verified.
examples/ts-only/tsconfig-isolated.json present; no occurrences of "transpilation: true" found outside node_modules.examples/react-app/tsconfig-esm-isolated.spec.json (1)
1-6: LGTM — isolatedModules enabled; JSX confirmed in base tsconfig (examples/react-app/tsconfig.json contains "jsx": "react-jsx").
examples/react-app/tsconfig-esm-isolated.spec.json → extends ./tsconfig-esm.spec.json → ./tsconfig.spec.json → ./tsconfig.json which sets JSX.examples/react-app/jest-esm-isolated.config.ts (1)
5-5: Keep the .spec tsconfig — no change needed.
examples/react-app/tsconfig-esm-isolated.spec.json exists; keep the tsconfig entry as-is.Likely an incorrect or invalid review comment.
examples/ts-only/tsconfig-esm-isolated.json (1)
1-6: LGTM — confirm consumer config references this fileScript returned no output; unable to confirm examples/ts-only/tsconfig-esm.json exists or that the examples/ts-only jest-esm-isolated config references examples/ts-only/tsconfig-esm-isolated.json. Verify those paths and update consumer config if needed.
e2e/transformer-in-ts/tsconfig-esm-transpiler.spec.json (1)
1-6: LGTM — please confirm tsconfig presence and consumer references.Sandbox verification returned no hits; confirm e2e/tsconfig-esm.spec.json (or ../tsconfig-esm.spec.json relative to e2e/transformer-in-ts) exists and that consumers reference e2e/transformer-in-ts/tsconfig-esm-transpiler.spec.json.
e2e/hoist-jest/tsconfig-cjs-transpiler.spec.json (1)
1-6: LGTM — config wiring verified.
e2e/hoist-jest/tsconfig-cjs.spec.json exists and e2e/hoist-jest/jest-transpiler-cjs.config.ts references '/tsconfig-cjs-transpiler.spec.json'.examples/monorepo-app/type-module/tsconfig-esm-isolated.json (1)
1-6: LGTM — verify Jest config references this tsconfigexamples/monorepo-app/type-module/tsconfig-esm-isolated.json exists and sets "isolatedModules": true (it extends tsconfig-esm.json). I could not find jest-esm-isolated.config.ts or any repo reference to "tsconfig-esm-isolated.json"; verify the package's Jest config points to this filename.
examples/monorepo-app/type-module/tsconfig-esm-isolated.json
examples/monorepo-app/type-module/tsconfig-esm.jsone2e/transformer-options/tsconfig-cjs-transpiler.spec.json (1)
1-6: LGTM — Jest config already points to this tsconfig.
e2e/transformer-options/jest-transpiler-cjs.config.ts → tsconfig: '/tsconfig-cjs-transpiler.spec.json'; jest-e2e-cjs.config.ts includes 'e2e/**/jest-transpiler-cjs.config.ts'.e2e/enum/jest-transpiler-cjs.config.ts (1)
9-10: LGTM — ensuretranspilation: trueis removed repo‑wide.
My rg check returned "No files were searched" (ripgrep applied ignore filters), so I couldn't verify; run an unrestricted search (e.g. rg -uu --hidden -nP 'transpilation\s*:' or git grep -n 'transpilation') and confirm no instances remain.examples/ts-only/tsconfig-isolated.json (1)
1-6: LGTM: minimal isolatedModules overlay looks correct.
No further changes needed here.examples/js-with-ts/tsconfig-isolated.json (1)
1-6: LGTM: matches the base pattern and keeps scope tight.
Confirm jest-isolated config references this path.e2e/presets/tsconfig-cjs-transpiler.spec.json (1)
1-6: LGTM: CJS preset overlay is valid.
No trailing commas; path resolution looks fine.e2e/enum/tsconfig-esm-transpiler.spec.json (1)
1-6: LGTM: ESM overlay mirrors other directories consistently.
Nothing else to flag.e2e/transform-js/jest-transpiler-esm.config.ts (1)
10-12: Config aligns with ESM transform — referenced tsconfig present.
e2e/transform-js/tsconfig-esm-transpiler.spec.json confirmed present (verification script returned no output).e2e/source-map/jest-transpiler-esm.config.ts (1)
10-12: Transform config update looks good — confirm repo‑wide removal of deprecatedtranspilationflag.
Switched tsconfig/useESM here; no activetranspilationconfig/property found, but the term remains in documentation/changelog (CHANGELOG.md, website/docs/** and website/versioned_docs/** — e.g. guides/troubleshooting.md, guides/esm-support.md, processing.md).examples/js-with-babel/tsconfig-isolated.json (1)
1-6: LGTM: Babel example overlay is minimal and correct — verified jest configs.
examples/js-with-babel/jest-isolated.config.ts contains babelConfig: true and tsconfig: 'tsconfig-isolated.json'; no jest-esm-isolated config found in examples/js-with-babel.e2e/const-enum/tsconfig-esm-transpiler.spec.json (1)
1-6: Fix JSON trailing comma (parse error).
Trailing comma after "isolatedModules": true makes this file invalid JSON — remove the comma.File: e2e/const-enum/tsconfig-esm-transpiler.spec.json (lines 1-6)
Apply:
{ "extends": "./tsconfig-esm.spec.json", "compilerOptions": { - "isolatedModules": true, + "isolatedModules": true } }e2e/test-utils/jest-transpiler-esm.config.ts (1)
10-12: Consistent ESM transpiler tsconfig usage.Correct pairing of useESM with isolated tsconfig.
e2e/extend-ts-jest/jest-transpiler-cjs.config.ts (1)
9-10: CJS transpiler config aligned with isolated tsconfig.Configuration is consistent with the broader revert/migration.
e2e/test-utils/tsconfig-cjs-transpiler.spec.json (1)
1-6: LGTM: isolated CJS tsconfig added.Keeps behavior consistent with other CJS e2e suites.
e2e/transform-js/tsconfig-esm-transpiler.spec.json (1)
1-6: LGTM: isolated ESM tsconfig for transform-js.Matches the ESM pattern used elsewhere.
e2e/esm-features/jest-compiler-esm.config.ts (1)
10-12: Approve — tsconfig-esm-transpiler.spec.json present and isolatedModules=true.
Ensures config parity with other ESM suites.examples/react-app/tsconfig-isolated.spec.json (1)
1-6: LGTM: isolated tsconfig for the React example — confirm Jest config & scripts reference it
Search found no references to examples/react-app/tsconfig-isolated.spec.json; confirm examples/react-app Jest config (jest.config.js or package.json "jest" field) and package.json scripts point to this file or update them.e2e/esm-features/tsconfig-esm-transpiler.spec.json (1)
1-6: LGTM: minimal isolatedModules overlayExtends path and option look correct.
e2e/presets/tsconfig-esm-transpiler.spec.json (1)
1-6: LGTMConsistent with the other ESM overlays.
e2e/extend-ts-jest/tsconfig-esm-transpiler.spec.json (1)
1-6: LGTMMatches the pattern used elsewhere; no issues spotted.
e2e/presets/jest-transpiler-esm.config.ts (1)
10-12: Confirm revert intent:transpilationremoval?File: e2e/presets/jest-transpiler-esm.config.ts (lines 10–12). Your rg run returned "No files were searched" so repo-wide verification was inconclusive — confirm whether dropping
transpilation: trueis intentional for this revert; otherwise restore:{ tsconfig: '<rootDir>/tsconfig-esm-transpiler.spec.json', useESM: true, + transpilation: true, },e2e/const-enum/__tests__/const-enum.spec.ts (1)
4-10: LGTM — small helper extraction OK; verify preserveConstEnums=falseCouldn't read e2e/const-enum tsconfigs (permission denied); confirm compilerOptions.preserveConstEnums is set to false in e2e/const-enum/tsconfig-esm-transpiler.spec.json and e2e/const-enum/tsconfig-cjs-transpiler.spec.json (or their extended configs) so const-enum inlining is validated under isolatedModules/transpile.
e2e/presets/jest-transpiler-cjs.config.ts (1)
9-10: CJS preset: confirm revert intent mirrors ESMNeither e2e/presets/jest-transpiler-cjs.config.ts nor e2e/presets/jest-transpiler-esm.config.ts define a
transpilationproperty — confirm whethertranspilation: trueshould be restored to the CJS preset (and to ESM if you want the revert to be symmetric).examples/js-with-babel/jest-esm-isolated.config.ts (1)
8-9: Confirmed: tsconfig exists and correctly configures ESM + isolatedModulesexamples/js-with-babel/tsconfig-esm-isolated.json exists, sets "isolatedModules": true, and extends ./tsconfig-esm.json (which sets "module": "ESNext").
e2e/transformer-in-ts/jest-transpiler-esm.config.ts (1)
10-10: ESM tsconfig switch looks right; confirm file presence and ESM settingsChange is fine. Ensure tsconfig-esm-transpiler.spec.json exists alongside this config and carries isolatedModules: true; keep useESM aligned with module settings in that tsconfig.
examples/monorepo-app/type-module/jest-esm-isolated.config.ts (1)
7-7: Preset now driven by tsconfig — goodLooks good. Confirm tsconfig-esm-isolated.json sets module resolution for ESM (e.g., module: node16/nodeNext or ESNext) and isolatedModules: true.
examples/monorepo-app/type-commonjs/jest-isolated.config.ts (1)
7-7: CJS preset tsconfig switch — OKEnsure tsconfig-isolated.json aligns with CJS (module: commonjs) and sets isolatedModules: true.
e2e/transformer-in-ts/jest-transpiler-cjs.config.ts (1)
9-9: CJS transformer config — tsconfig swap LGTMPath update is consistent with the revert. Verify tsconfig-cjs-transpiler.spec.json exists and contains isolatedModules: true; hoist-jest transformer path remains valid.
e2e/transformer-options/jest-transpiler-cjs.config.ts (1)
10-20: Check FormatJS transformer compatibility under isolated modulesThe tsconfig change is fine. Please confirm @formatjs/ts-transformer still runs as expected when using transpile-only/isolatedModules; some transformers require type info and may differ.
e2e/const-enum/jest-transpiler-cjs.config.ts (1)
9-10: Good revert to dedicated tsconfig — confirm tsconfig exists and isolatedModules is true
- Ensure e2e/const-enum/jest-transpiler-cjs.config.ts references '/tsconfig-cjs-transpiler.spec.json' and that that tsconfig file exists and sets "isolatedModules": true.
- If any config still uses TS_JS_TRANSFORM_PATTERN, either set "allowJs": true in the referenced tsconfig or replace usages/imports with TS_TRANSFORM_PATTERN (example diff below).
- import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest' + import { type JestConfigWithTsJest, TS_TRANSFORM_PATTERN } from 'ts-jest' ... - [TS_JS_TRANSFORM_PATTERN]: [ + [TS_TRANSFORM_PATTERN]: [examples/monorepo-app/type-commonjs/jest-esm-isolated.config.ts (1)
7-8: LGTM; consistent ESM preset usage.
Confirmed examples/monorepo-app/type-commonjs/tsconfig-esm-isolated.json exists and compilerOptions.isolatedModules is true.e2e/transform-js/jest-transpiler-cjs.config.ts (1)
9-10: CJS transpiler path correct — tsconfig present; verify repo‑wide removal oftranspilation:flags.e2e/transform-js/jest-transpiler-cjs.config.ts points to '/tsconfig-cjs-transpiler.spec.json' and e2e/transform-js/tsconfig-cjs-transpiler.spec.json exists; automated search didn't scan files (rg reported "No files were searched") — run a repo-wide grep for
transpilation:to confirm.e2e/enum/jest-transpiler-esm.config.ts (1)
10-12: tsconfig verified; no setupFiles in this config — confirm matcher registration
- Verified: e2e/enum/tsconfig-esm-transpiler.spec.json exists and compilerOptions.isolatedModules = true.
- Observed: e2e/enum/jest-transpiler-esm.config.ts has no setupFiles or setupFilesAfterEnv. Ensure the setup file that registers matcher extensions (calls expect.extend or imports jest-extended) is applied when running tests with this config — either add the setup file to this config or confirm it’s provided by a root/preset config so this revert actually addresses #5049.
src/legacy/config/config-set.spec.ts (3)
14-14: Import of interpolate is correctImporting interpolate for dynamic deprecation messages is appropriate.
1153-1177: Good deprecation coverage when tsconfig path existsTest clearly asserts Deprecations.IsolatedModulesWithTsconfigPath with formatted path; nice.
1195-1196: Good deprecation coverage when tsconfig path is absentExpectation matches the new message key.
examples/react-app/package.json (1)
9-12: React app scripts—isolated configs present
Both jest-isolated.config.ts and jest-esm-isolated.config.ts are present at examples/react-app/.examples/monorepo-app/jest-esm-isolated.config.ts (1)
1-8: Config wrapper verified — child configs existBoth referenced files are present: examples/monorepo-app/type-commonjs/jest-esm-isolated.config.ts and examples/monorepo-app/type-module/jest-esm-isolated.config.ts.
e2e/transformer-options/jest-transpiler-esm.config.ts (1)
11-11: tsconfig file present — no action required
tsconfig-esm-transpiler.spec.json exists at e2e/transformer-options/tsconfig-esm-transpiler.spec.json.e2e/test-utils/jest-transpiler-cjs.config.ts (1)
9-10: CJS transpiler tsconfig path exists — no action required.
Confirmed e2e/test-utils/tsconfig-cjs-transpiler.spec.json is present.examples/monorepo-app/package.json (1)
12-15: New isolated scripts — top-level configs are present
Found examples/monorepo-app/jest-isolated.config.ts and examples/monorepo-app/jest-esm-isolated.config.ts (also present under type-commonjs/ and type-module/).website/versioned_docs/version-29.4/getting-started/presets.md (1)
33-34: Docs: isolatedModules links/types verified — notranspilationfound
- website/versioned_docs/version-29.4/getting-started/options/isolatedModules.md exists.
- Public type: src/types.ts:86 —
isolatedModules?: boolean; raw option: src/raw-compiler-options.ts:293 —isolatedModules?: boolean | null.- No
transpilationoccurrences found in src.examples/js-with-ts/package.json (1)
7-9: Incorrect — repository already reverted to isolated configs.
examples/js-with-ts/package.json already has "test-isolated" and "test-esm-isolated", isolated Jest configs exist (jest-isolated.config.ts, jest-esm-isolated.config.ts), and commit d82c8c9 reverts the transpilation change; restoring "transpiler" scripts is not applicable.Likely an incorrect or invalid review comment.
examples/ts-only/package.json (2)
7-9: Config files present — run example tests locallyFound examples/ts-only/jest-isolated.config.ts and examples/ts-only/jest-esm-isolated.config.ts (with tsconfig-isolated.json and tsconfig-esm-isolated.json); the package.json scripts reference them. Run in examples/ts-only: npm run test-isolated and npm run test-esm-isolated to confirm the examples pass.
7-9: Fix Jest/ts-jest version mismatch in examples/ts-only/package.json.
ts-jest 29.x does not support Jest 30 — update ts-jest to ^30.x or downgrade jest to ^29.x so the examples' declared versions are compatible.⛔ Skipped due to learnings
Learnt from: ahnpnl PR: kulshekhar/ts-jest#4976 File: examples/js-with-babel/package.json:14-19 Timestamp: 2025-08-05T08:03:52.583Z Learning: ts-jest version 29 supports both Jest 29 and Jest 30, so having ts-jest 29.x with Jest 30.x is not a compatibility issue and should not be flagged as a version mismatch problem.
|
@kulshekhar we need to revert this ASAP 😄 |



Summary
Closes #5049
Test plan
Green CI
Does this PR introduce a breaking change?
Other information
N.A.
Summary by CodeRabbit
New Features
Documentation
Chores
Tests