ts-jest 29.4.11 → 29.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.ts-jest-digest CHANGED
@@ -1 +1 @@
1
- 73233cd15fa36234d30a07a1efa9643162305524
1
+ e03565d622606f8aecc2fef451190dba6868e7fe
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [29.4.12](https://github.com/kulshekhar/ts-jest/compare/v29.4.11...v29.4.12) (2026-07-22)
2
+
3
+
4
+ ### Features
5
+
6
+ * **compiler:** support TypeScript 7 projects through compatibility aliases ([#5386](https://github.com/kulshekhar/ts-jest/pull/5386))
7
+
1
8
  ## [29.4.11](https://github.com/kulshekhar/ts-jest/compare/v29.4.10...v29.4.11) (2026-05-21)
2
9
 
3
10
 
@@ -2071,4 +2078,3 @@ For example
2071
2078
  # 0.0.0 (2016-08-30)
2072
2079
 
2073
2080
 
2074
-
package/README.md CHANGED
@@ -35,12 +35,15 @@ It supports all features of TypeScript including type-checking. [Read more about
35
35
 
36
36
  These instructions will get you setup to use `ts-jest` in your project. For more detailed documentation, please check [online documentation](https://kulshekhar.github.io/ts-jest).
37
37
 
38
- | | using npm | using yarn |
39
- | ------------------: | ------------------------------ | ------------------------------------ |
40
- | **Prerequisites** | `npm i -D jest typescript` | `yarn add --dev jest typescript` |
41
- | **Installing** | `npm i -D ts-jest @types/jest` | `yarn add --dev ts-jest @types/jest` |
42
- | **Creating config** | `npx ts-jest config:init` | `yarn ts-jest config:init` |
43
- | **Running tests** | `npm test` or `npx jest` | `yarn test` or `yarn jest` |
38
+ | | using npm | using yarn |
39
+ | -----------------------------------: | ------------------------------ | ------------------------------------ |
40
+ | **Prerequisites (TypeScript 4.3–6)** | `npm i -D jest typescript` | `yarn add --dev jest typescript` |
41
+ | **Installing** | `npm i -D ts-jest @types/jest` | `yarn add --dev ts-jest @types/jest` |
42
+ | **Creating config** | `npx ts-jest config:init` | `yarn ts-jest config:init` |
43
+ | **Running tests** | `npm test` or `npx jest` | `yarn test` or `yarn jest` |
44
+
45
+ If your project uses TypeScript 7, follow the [supported side-by-side compiler setup](website/docs/guides/typescript-7.md)
46
+ instead of installing `typescript` directly.
44
47
 
45
48
  ## Built With
46
49
 
@@ -124,5 +124,12 @@ export declare class TsCompiler implements TsCompilerInstance {
124
124
  private preserveCustomConditionsIfCompatible;
125
125
  getCompiledOutput(fileContent: string, fileName: string, options: TsJestCompileOptions): CompiledOutput;
126
126
  protected _transpileOutput(fileContent: string, fileName: string): TranspileOutput;
127
+ /**
128
+ * TypeScript 6 reports TS5107 when ts-jest's historical default of
129
+ * `moduleResolution: Node10` is passed to `transpileModule`. The diagnostic
130
+ * is an implementation detail when ts-jest injected that value, but remains
131
+ * actionable when the user selected Node10 themselves.
132
+ */
133
+ private _filterDiagnosticsFromTsJestDefaults;
127
134
  protected _makeTransformers(customTransformers: TsJestAstTransformer): CustomTransformers;
128
135
  }
@@ -376,12 +376,14 @@ class TsCompiler {
376
376
  * This code path should be removed in the next major version to benefit from checking on compiler options
377
377
  */
378
378
  if (!(0, transpile_module_1.isModernNodeModuleKind)(this._initialCompilerOptions.module)) {
379
- return this._ts.transpileModule(fileContent, {
379
+ const result = this._ts.transpileModule(fileContent, {
380
380
  fileName,
381
381
  transformers: this._makeTransformers(this.configSet.resolvedTransformers),
382
382
  compilerOptions: this._compilerOptions,
383
383
  reportDiagnostics: this.configSet.shouldReportDiagnostics(fileName),
384
384
  });
385
+ const diagnostics = this._filterDiagnosticsFromTsJestDefaults(result.diagnostics);
386
+ return diagnostics === result.diagnostics ? result : { ...result, diagnostics };
385
387
  }
386
388
  return (0, transpile_module_1.tsTranspileModule)(fileContent, {
387
389
  fileName,
@@ -393,6 +395,24 @@ class TsCompiler {
393
395
  reportDiagnostics: fileName ? this.configSet.shouldReportDiagnostics(fileName) : false,
394
396
  });
395
397
  }
398
+ /**
399
+ * TypeScript 6 reports TS5107 when ts-jest's historical default of
400
+ * `moduleResolution: Node10` is passed to `transpileModule`. The diagnostic
401
+ * is an implementation detail when ts-jest injected that value, but remains
402
+ * actionable when the user selected Node10 themselves.
403
+ */
404
+ _filterDiagnosticsFromTsJestDefaults(diagnostics) {
405
+ // `Node10` was exposed as `NodeJs` (with the same value) by older supported TypeScript releases.
406
+ const node10 = this._ts.ModuleResolutionKind.Node10 ?? 2;
407
+ const tsMajor = Number.parseInt(this._ts.version.split('.')[0], 10);
408
+ const hasInjectedNode10 = tsMajor >= 6 &&
409
+ this._initialCompilerOptions.moduleResolution === undefined &&
410
+ this._compilerOptions.moduleResolution === node10;
411
+ if (!hasInjectedNode10 || !diagnostics?.some((diagnostic) => diagnostic.code === 5107)) {
412
+ return diagnostics;
413
+ }
414
+ return diagnostics.filter((diagnostic) => diagnostic.code !== 5107);
415
+ }
396
416
  _makeTransformers(customTransformers) {
397
417
  return {
398
418
  before: customTransformers.before.map((beforeTransformer) => beforeTransformer.factory(this, beforeTransformer.options)),
@@ -27,7 +27,17 @@ class Importer {
27
27
  return this._import(why, '@babel/core');
28
28
  }
29
29
  typescript(why, which) {
30
- return this._import(why, which);
30
+ const compilerModule = this._import(why, which);
31
+ const hasRequiredCompilerApi = typeof compilerModule.createLanguageService === 'function' &&
32
+ typeof compilerModule.parseJsonConfigFileContent === 'function' &&
33
+ typeof compilerModule.transpileModule === 'function';
34
+ if (!hasRequiredCompilerApi) {
35
+ throw new Error((0, messages_1.interpolate)("The TypeScript compiler \"{{module}}\" (version {{version}}) does not expose the JavaScript compiler API required by ts-jest. To use TypeScript 7 for project type-checking, install it as \"@typescript/native\" and alias \"@typescript/typescript6\" as \"typescript\" for ts-jest." /* Errors.TypeScriptCompilerApiUnavailable */, {
36
+ module: which,
37
+ version: compilerModule.version ?? 'unknown',
38
+ }));
39
+ }
40
+ return compilerModule;
31
41
  }
32
42
  esBuild(why) {
33
43
  return this._import(why, 'esbuild');
package/npm-view.err CHANGED
@@ -1,9 +1,9 @@
1
1
  npm warn Unknown user config "always-auth". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
2
2
  npm error code E404
3
- npm error 404 No match found for version 29.4.11
3
+ npm error 404 No match found for version 29.4.12
4
4
  npm error 404
5
- npm error 404 The requested resource 'ts-jest@29.4.11' could not be found or you do not have permission to access it.
5
+ npm error 404 The requested resource 'ts-jest@29.4.12' could not be found or you do not have permission to access it.
6
6
  npm error 404
7
7
  npm error 404 Note that you can also install from a
8
8
  npm error 404 tarball, folder, http url, or git url.
9
- npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2026-05-21T13_47_16_595Z-debug-0.log
9
+ npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2026-07-22T07_45_38_792Z-debug-0.log
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-jest",
3
- "version": "29.4.11",
3
+ "version": "29.4.12",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "commonjs",
@@ -57,7 +57,7 @@
57
57
  "json5": "^2.2.3",
58
58
  "lodash.memoize": "^4.1.2",
59
59
  "make-error": "^1.3.6",
60
- "semver": "^7.8.0",
60
+ "semver": "^7.8.5",
61
61
  "type-fest": "^4.41.0",
62
62
  "yargs-parser": "^21.1.1"
63
63
  },
@@ -94,8 +94,8 @@
94
94
  "@commitlint/cli": "^19.8.1",
95
95
  "@commitlint/config-angular": "^19.8.1",
96
96
  "@eslint/compat": "^1.4.1",
97
- "@eslint/eslintrc": "^3.3.5",
98
- "@eslint/js": "^9.39.4",
97
+ "@eslint/eslintrc": "^3.3.6",
98
+ "@eslint/js": "^9.39.5",
99
99
  "@jest/globals": "^30.4.1",
100
100
  "@jest/transform": "^30.4.1",
101
101
  "@jest/types": "^30.4.1",
@@ -107,17 +107,17 @@
107
107
  "@types/lodash.memoize": "^4.1.9",
108
108
  "@types/lodash.set": "^4.3.9",
109
109
  "@types/micromatch": "^4.0.10",
110
- "@types/node": "20.19.41",
110
+ "@types/node": "20.19.43",
111
111
  "@types/semver": "^7.7.1",
112
112
  "@types/yargs": "^17.0.35",
113
113
  "@types/yargs-parser": "21.0.3",
114
- "@typescript-eslint/eslint-plugin": "^8.59.3",
115
- "@typescript-eslint/parser": "^8.59.3",
114
+ "@typescript-eslint/eslint-plugin": "^8.64.0",
115
+ "@typescript-eslint/parser": "^8.64.0",
116
116
  "babel-jest": "^30.4.1",
117
117
  "conventional-changelog-angular": "^8.3.1",
118
- "conventional-changelog": "^7.2.0",
119
- "esbuild": "~0.28.0",
120
- "eslint": "^9.39.4",
118
+ "conventional-changelog": "^7.2.1",
119
+ "esbuild": "~0.28.1",
120
+ "eslint": "^9.39.5",
121
121
  "eslint-config-prettier": "^10.1.8",
122
122
  "eslint-plugin-import": "^2.32.0",
123
123
  "eslint-plugin-jest": "^28.14.0",
@@ -125,18 +125,18 @@
125
125
  "eslint-plugin-prettier": "^4.2.5",
126
126
  "execa": "5.1.1",
127
127
  "fast-glob": "^3.3.3",
128
- "fs-extra": "^11.3.5",
128
+ "fs-extra": "^11.3.6",
129
129
  "globals": "^16.5.0",
130
130
  "husky": "^9.1.7",
131
131
  "jest": "^30.4.2",
132
- "js-yaml": "^4.1.1",
132
+ "js-yaml": "^4.3.0",
133
133
  "lint-staged": "^15.5.2",
134
- "memfs": "^4.57.2",
134
+ "memfs": "^4.64.0",
135
135
  "prettier": "^2.8.8",
136
136
  "rimraf": "^5.0.10",
137
137
  "ts-node": "^10.9.2",
138
138
  "typescript": "~5.9.3",
139
- "typescript-eslint": "^8.59.3"
139
+ "typescript-eslint": "^8.64.0"
140
140
  },
141
141
  "engines": {
142
142
  "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0"