ts-jest 29.4.6 → 29.4.8
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 +1 -1
- package/CHANGELOG.md +15 -0
- package/dist/config/define-config.d.ts +17 -0
- package/dist/config/define-config.js +41 -0
- package/dist/config/diagnostics.d.ts +5 -0
- package/dist/config/diagnostics.js +8 -0
- package/dist/experimental/index.d.ts +1 -0
- package/dist/experimental/index.js +17 -0
- package/dist/experimental/option-validator.d.ts +1 -0
- package/dist/experimental/option-validator.js +67 -0
- package/dist/legacy/config/config-set.js +0 -1
- package/package.json +21 -21
package/.ts-jest-digest
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5a52a8b09815c44895c89cd5d7b70f8b997b82a2
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [29.4.8](https://github.com/kulshekhar/ts-jest/compare/v29.4.7...v29.4.8) (2026-04-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
- wrong published assets
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [29.4.7](https://github.com/kulshekhar/ts-jest/compare/v29.4.6...v29.4.7) (2026-04-01)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* support TypeScript v6 ([eda517d](https://github.com/kulshekhar/ts-jest/commit/eda517d226389317d99572887d3c1aa93c81be87))
|
|
15
|
+
|
|
1
16
|
## [29.4.6](https://github.com/kulshekhar/ts-jest/compare/v29.4.5...v29.4.6) (2025-12-01)
|
|
2
17
|
|
|
3
18
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to define a Jest configuration with ts-jest.
|
|
3
|
+
* This function provides type safety and runtime validation for experimental features.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import { defineConfig } from 'ts-jest'
|
|
8
|
+
*
|
|
9
|
+
* export default defineConfig({
|
|
10
|
+
* testEnvironment: 'node',
|
|
11
|
+
* future: {
|
|
12
|
+
* // experimental features go here
|
|
13
|
+
* }
|
|
14
|
+
* })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const defineConfig: (config: InitialTestConfig) => InitialTestConfig;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineConfig = void 0;
|
|
4
|
+
const experimental_1 = require("../experimental");
|
|
5
|
+
/**
|
|
6
|
+
* Helper function to define a Jest configuration with ts-jest.
|
|
7
|
+
* This function provides type safety and runtime validation for experimental features.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { defineConfig } from 'ts-jest'
|
|
12
|
+
*
|
|
13
|
+
* export default defineConfig({
|
|
14
|
+
* testEnvironment: 'node',
|
|
15
|
+
* future: {
|
|
16
|
+
* // experimental features go here
|
|
17
|
+
* }
|
|
18
|
+
* })
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
const defineConfig = (config) => {
|
|
22
|
+
if ('future' in config) {
|
|
23
|
+
if (typeof config.future !== 'object' || config.future === null || Array.isArray(config.future)) {
|
|
24
|
+
throw new TypeError("Invalid 'future' configuration: Future config must be an object");
|
|
25
|
+
}
|
|
26
|
+
if (config.future?.experimental_validateOptions) {
|
|
27
|
+
if (config.transform) {
|
|
28
|
+
for (const [, transformer] of Object.entries(config.transform)) {
|
|
29
|
+
if (Array.isArray(transformer) && transformer.length > 1) {
|
|
30
|
+
const [transformerName, options] = transformer;
|
|
31
|
+
if (typeof transformerName === 'string' && transformerName === 'ts-jest') {
|
|
32
|
+
(0, experimental_1.validateOptions)(options);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return config;
|
|
40
|
+
};
|
|
41
|
+
exports.defineConfig = defineConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './option-validator';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./option-validator"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.validateOptions = void 0;
|
|
37
|
+
const v = __importStar(require("valibot"));
|
|
38
|
+
/**
|
|
39
|
+
* Valibot schema for ts-jest options validation
|
|
40
|
+
*/
|
|
41
|
+
const tsJestOptionsSchema = v.strictObject({
|
|
42
|
+
tsconfig: v.optional(v.union([v.string(), v.record(v.string(), v.any())])),
|
|
43
|
+
isolatedModules: v.optional(v.boolean()),
|
|
44
|
+
compiler: v.optional(v.string()),
|
|
45
|
+
astTransformers: v.optional(v.record(v.string(), v.any())),
|
|
46
|
+
diagnostics: v.optional(v.union([v.boolean(), v.record(v.string(), v.any())])),
|
|
47
|
+
babelConfig: v.optional(v.union([v.boolean(), v.string(), v.record(v.string(), v.any())])),
|
|
48
|
+
stringifyContentPathRegex: v.optional(v.union([v.string(), v.instance(RegExp)])),
|
|
49
|
+
useESM: v.optional(v.boolean()),
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
*
|
|
54
|
+
* Validates `ts-jest` transformer options with both TypeScript types and runtime validation about unrecognized options to help catch typos and configuration errors.
|
|
55
|
+
*/
|
|
56
|
+
const validateOptions = (options) => {
|
|
57
|
+
try {
|
|
58
|
+
v.parse(tsJestOptionsSchema, options);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (error instanceof v.ValiError) {
|
|
62
|
+
throw new Error(error.message);
|
|
63
|
+
}
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.validateOptions = validateOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-jest",
|
|
3
|
-
"version": "29.4.
|
|
3
|
+
"version": "29.4.8",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"bs-logger": "^0.2.6",
|
|
55
55
|
"fast-json-stable-stringify": "^2.1.0",
|
|
56
|
-
"handlebars": "^4.7.
|
|
56
|
+
"handlebars": "^4.7.9",
|
|
57
57
|
"json5": "^2.2.3",
|
|
58
58
|
"lodash.memoize": "^4.1.2",
|
|
59
59
|
"make-error": "^1.3.6",
|
|
60
|
-
"semver": "^7.7.
|
|
60
|
+
"semver": "^7.7.4",
|
|
61
61
|
"type-fest": "^4.41.0",
|
|
62
62
|
"yargs-parser": "^21.1.1"
|
|
63
63
|
},
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"babel-jest": "^29.0.0 || ^30.0.0",
|
|
69
69
|
"jest": "^29.0.0 || ^30.0.0",
|
|
70
70
|
"jest-util": "^29.0.0 || ^30.0.0",
|
|
71
|
-
"typescript": ">=4.3 <
|
|
71
|
+
"typescript": ">=4.3 <7"
|
|
72
72
|
},
|
|
73
73
|
"peerDependenciesMeta": {
|
|
74
74
|
"@babel/core": {
|
|
@@ -94,11 +94,11 @@
|
|
|
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.
|
|
98
|
-
"@eslint/js": "^9.39.
|
|
99
|
-
"@jest/globals": "^30.
|
|
100
|
-
"@jest/transform": "^30.
|
|
101
|
-
"@jest/types": "^30.
|
|
97
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
98
|
+
"@eslint/js": "^9.39.4",
|
|
99
|
+
"@jest/globals": "^30.3.0",
|
|
100
|
+
"@jest/transform": "^30.3.0",
|
|
101
|
+
"@jest/types": "^30.3.0",
|
|
102
102
|
"@types/babel__core": "^7.20.5",
|
|
103
103
|
"@types/fs-extra": "^11.0.4",
|
|
104
104
|
"@types/jest": "^29.5.14",
|
|
@@ -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.
|
|
110
|
+
"@types/node": "20.19.37",
|
|
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.
|
|
115
|
-
"@typescript-eslint/parser": "^8.
|
|
116
|
-
"babel-jest": "^30.
|
|
117
|
-
"conventional-changelog-angular": "^8.
|
|
118
|
-
"conventional-changelog": "^7.
|
|
119
|
-
"esbuild": "~0.27.
|
|
120
|
-
"eslint": "^9.39.
|
|
114
|
+
"@typescript-eslint/eslint-plugin": "^8.57.2",
|
|
115
|
+
"@typescript-eslint/parser": "^8.57.2",
|
|
116
|
+
"babel-jest": "^30.3.0",
|
|
117
|
+
"conventional-changelog-angular": "^8.3.0",
|
|
118
|
+
"conventional-changelog": "^7.2.0",
|
|
119
|
+
"esbuild": "~0.27.4",
|
|
120
|
+
"eslint": "^9.39.4",
|
|
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.
|
|
128
|
+
"fs-extra": "^11.3.4",
|
|
129
129
|
"globals": "^16.5.0",
|
|
130
130
|
"husky": "^9.1.7",
|
|
131
|
-
"jest": "^30.
|
|
131
|
+
"jest": "^30.3.0",
|
|
132
132
|
"js-yaml": "^4.1.1",
|
|
133
133
|
"lint-staged": "^15.5.2",
|
|
134
|
-
"memfs": "^4.
|
|
134
|
+
"memfs": "^4.57.1",
|
|
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.
|
|
139
|
+
"typescript-eslint": "^8.57.2"
|
|
140
140
|
},
|
|
141
141
|
"engines": {
|
|
142
142
|
"node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0"
|