ts-jest 29.0.5 → 29.1.0
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 +9 -0
- package/dist/cli/config/init.js +1 -1
- package/dist/cli/config/migrate.js +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/config/paths-to-module-name-mapper.d.ts +1 -1
- package/dist/legacy/ts-jest-transformer.js +5 -5
- package/dist/types.d.ts +5 -5
- package/dist/utils/importer.js +1 -2
- package/dist/utils/version-checkers.js +1 -2
- package/package.json +17 -18
package/.ts-jest-digest
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f6e34109d41dee339b6e88923445c043034af30a
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
# [29.1.0](https://github.com/kulshekhar/ts-jest/compare/v29.0.5...v29.1.0) (2023-03-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Support TypeScript 5.x ([#4064](https://github.com/kulshekhar/ts-jest/issues/4064)) ([db98cc9](https://github.com/kulshekhar/ts-jest/commit/87f27821db99be411288b50a4f9baa7bedb98cc9)), closes [#4048](https://github.com/kulshekhar/ts-jest/issues/4048)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## [29.0.5](https://github.com/kulshekhar/ts-jest/compare/v29.0.4...v29.0.5) (2023-01-13)
|
|
2
11
|
|
|
3
12
|
|
package/dist/cli/config/init.js
CHANGED
|
@@ -30,7 +30,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
30
30
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
31
31
|
function step(op) {
|
|
32
32
|
if (f) throw new TypeError("Generator is already executing.");
|
|
33
|
-
while (_) try {
|
|
33
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
34
34
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
35
35
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
36
36
|
switch (op[0]) {
|
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
package/dist/cli/help.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/cli/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Config } from '@jest/types';
|
|
2
|
-
|
|
2
|
+
type JestPathMapping = Config.InitialOptions['moduleNameMapper'];
|
|
3
3
|
export declare const pathsToModuleNameMapper: (mapping: import("typescript").MapLike<string[]>, { prefix, useESM }?: {
|
|
4
4
|
prefix?: string | undefined;
|
|
5
5
|
useESM?: boolean | undefined;
|
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
|
@@ -90,7 +90,7 @@ var config_set_1 = require("./config/config-set");
|
|
|
90
90
|
* @internal
|
|
91
91
|
*/
|
|
92
92
|
exports.CACHE_KEY_EL_SEPARATOR = '\x00';
|
|
93
|
-
var TsJestTransformer = /** @class */ (function () {
|
|
93
|
+
var TsJestTransformer = exports.TsJestTransformer = /** @class */ (function () {
|
|
94
94
|
function TsJestTransformer(tsJestConfig) {
|
|
95
95
|
this.tsJestConfig = tsJestConfig;
|
|
96
96
|
this._depGraphs = new Map();
|
|
@@ -307,10 +307,11 @@ var TsJestTransformer = /** @class */ (function () {
|
|
|
307
307
|
*/
|
|
308
308
|
TsJestTransformer.prototype.getCacheKey = function (fileContent, filePath, transformOptions) {
|
|
309
309
|
var _a;
|
|
310
|
+
var _b;
|
|
310
311
|
var configs = this._configsFor(transformOptions);
|
|
311
312
|
this._logger.debug({ fileName: filePath, transformOptions: transformOptions }, 'computing cache key for', filePath);
|
|
312
313
|
// we do not instrument, ensure it is false all the time
|
|
313
|
-
var
|
|
314
|
+
var instrument = (_a = transformOptions.instrument, _a === void 0 ? false : _a);
|
|
314
315
|
var constructingCacheKeyElements = [
|
|
315
316
|
this._transformCfgStr,
|
|
316
317
|
exports.CACHE_KEY_EL_SEPARATOR,
|
|
@@ -324,7 +325,7 @@ var TsJestTransformer = /** @class */ (function () {
|
|
|
324
325
|
];
|
|
325
326
|
if (!configs.isolatedModules && this._tsResolvedModulesCachePath) {
|
|
326
327
|
var resolvedModuleNames = void 0;
|
|
327
|
-
if (((
|
|
328
|
+
if (((_b = this._depGraphs.get(filePath)) === null || _b === void 0 ? void 0 : _b.fileContent) === fileContent) {
|
|
328
329
|
this._logger.debug({ fileName: filePath, transformOptions: transformOptions }, 'getting resolved modules from disk caching or memory caching for', filePath);
|
|
329
330
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
330
331
|
resolvedModuleNames = this._depGraphs
|
|
@@ -377,4 +378,3 @@ var TsJestTransformer = /** @class */ (function () {
|
|
|
377
378
|
TsJestTransformer._cachedConfigSets = [];
|
|
378
379
|
return TsJestTransformer;
|
|
379
380
|
}());
|
|
380
|
-
exports.TsJestTransformer = TsJestTransformer;
|
package/dist/types.d.ts
CHANGED
|
@@ -15,11 +15,11 @@ declare module '@jest/types' {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export type TTypeScript = typeof _ts;
|
|
19
19
|
/**
|
|
20
20
|
* Don't mark as internal because it is used in TsJestGlobalOptions which is an exposed type
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export type BabelConfig = _babel.TransformOptions;
|
|
23
23
|
export interface AstTransformer<T = Record<string, unknown>> {
|
|
24
24
|
path: string;
|
|
25
25
|
options?: T;
|
|
@@ -141,14 +141,14 @@ export interface GlobalConfigTsJest extends Config.ConfigGlobals {
|
|
|
141
141
|
export interface InitialOptionsTsJest extends Config.InitialOptions {
|
|
142
142
|
globals?: GlobalConfigTsJest;
|
|
143
143
|
}
|
|
144
|
-
export
|
|
144
|
+
export type TsJestTransformerOptions = TsJestGlobalOptions;
|
|
145
145
|
export interface JestConfigWithTsJest extends Omit<Config.InitialOptions, 'transform'> {
|
|
146
146
|
transform?: {
|
|
147
147
|
[regex: string]: 'ts-jest' | 'ts-jest/legacy' | ['ts-jest', TsJestTransformerOptions] | ['ts-jest/legacy', TsJestTransformerOptions] | string | Config.TransformerConfig;
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
export
|
|
151
|
-
export
|
|
150
|
+
export type TsJestPresets = Pick<JestConfigWithTsJest, 'extensionsToTreatAsEsm' | 'moduleFileExtensions' | 'transform' | 'testMatch'>;
|
|
151
|
+
export type StringMap = Map<string, string>;
|
|
152
152
|
export interface DepGraphInfo {
|
|
153
153
|
fileContent: string;
|
|
154
154
|
resolvedModuleNames: string[];
|
package/dist/utils/importer.js
CHANGED
|
@@ -56,7 +56,7 @@ var passThru = function (action) { return function (input) {
|
|
|
56
56
|
/**
|
|
57
57
|
* @internal
|
|
58
58
|
*/
|
|
59
|
-
var Importer = /** @class */ (function () {
|
|
59
|
+
var Importer = exports.Importer = /** @class */ (function () {
|
|
60
60
|
function Importer(_patches) {
|
|
61
61
|
if (_patches === void 0) { _patches = {}; }
|
|
62
62
|
this._patches = _patches;
|
|
@@ -189,7 +189,6 @@ var Importer = /** @class */ (function () {
|
|
|
189
189
|
], Importer, "instance", null);
|
|
190
190
|
return Importer;
|
|
191
191
|
}());
|
|
192
|
-
exports.Importer = Importer;
|
|
193
192
|
/**
|
|
194
193
|
* @internal
|
|
195
194
|
*/
|
|
@@ -11,11 +11,10 @@ var logger = logger_1.rootLogger.child({ namespace: 'versions' });
|
|
|
11
11
|
*/
|
|
12
12
|
exports.VersionCheckers = {
|
|
13
13
|
jest: createVersionChecker('jest', ">=29.0.0 <30" /* ExpectedVersions.Jest */),
|
|
14
|
-
typescript: createVersionChecker('typescript', ">=4.3 <
|
|
14
|
+
typescript: createVersionChecker('typescript', ">=4.3 <6" /* ExpectedVersions.TypeScript */),
|
|
15
15
|
babelJest: createVersionChecker('babel-jest', ">=29.0.0 <30" /* ExpectedVersions.BabelJest */),
|
|
16
16
|
babelCore: createVersionChecker('@babel/core', ">=7.0.0-beta.0 <8" /* ExpectedVersions.BabelCore */),
|
|
17
17
|
};
|
|
18
|
-
// eslint-disable-next-line no-redeclare
|
|
19
18
|
function checkVersion(name, expectedRange, action) {
|
|
20
19
|
if (action === void 0) { action = 'warn'; }
|
|
21
20
|
var success = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-jest",
|
|
3
|
-
"version": "29.0
|
|
3
|
+
"version": "29.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@jest/types": "^29.0.0",
|
|
66
66
|
"babel-jest": "^29.0.0",
|
|
67
67
|
"jest": "^29.0.0",
|
|
68
|
-
"typescript": ">=4.3"
|
|
68
|
+
"typescript": ">=4.3 <6"
|
|
69
69
|
},
|
|
70
70
|
"peerDependenciesMeta": {
|
|
71
71
|
"@babel/core": {
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@commitlint/cli": "17.x",
|
|
93
|
-
"@commitlint/config-angular": "^17.4.
|
|
94
|
-
"@jest/transform": "^29.
|
|
95
|
-
"@jest/types": "^29.
|
|
93
|
+
"@commitlint/config-angular": "^17.4.4",
|
|
94
|
+
"@jest/transform": "^29.5.0",
|
|
95
|
+
"@jest/types": "^29.5.0",
|
|
96
96
|
"@types/babel__core": "7.x",
|
|
97
97
|
"@types/cross-spawn": "latest",
|
|
98
98
|
"@types/fs-extra": "latest",
|
|
@@ -101,20 +101,19 @@
|
|
|
101
101
|
"@types/lodash.memoize": "4.x",
|
|
102
102
|
"@types/lodash.set": "4.x",
|
|
103
103
|
"@types/micromatch": "4.x",
|
|
104
|
-
"@types/node": "18.11
|
|
105
|
-
"@types/node-fetch": "^3.0.3",
|
|
104
|
+
"@types/node": "18.15.11",
|
|
106
105
|
"@types/react": "18.x",
|
|
107
106
|
"@types/rimraf": "^3.0.2",
|
|
108
107
|
"@types/semver": "latest",
|
|
109
108
|
"@types/yargs": "latest",
|
|
110
109
|
"@types/yargs-parser": "21.x",
|
|
111
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
112
|
-
"@typescript-eslint/parser": "^5.
|
|
113
|
-
"babel-jest": "^29.
|
|
110
|
+
"@typescript-eslint/eslint-plugin": "^5.57.0",
|
|
111
|
+
"@typescript-eslint/parser": "^5.57.0",
|
|
112
|
+
"babel-jest": "^29.5.0",
|
|
114
113
|
"conventional-changelog-cli": "2.x",
|
|
115
114
|
"cross-spawn": "latest",
|
|
116
|
-
"esbuild": "~0.
|
|
117
|
-
"eslint": "^8.
|
|
115
|
+
"esbuild": "~0.17.14",
|
|
116
|
+
"eslint": "^8.37.0",
|
|
118
117
|
"eslint-config-prettier": "latest",
|
|
119
118
|
"eslint-plugin-import": "latest",
|
|
120
119
|
"eslint-plugin-jest": "latest",
|
|
@@ -123,19 +122,19 @@
|
|
|
123
122
|
"eslint-plugin-prettier": "latest",
|
|
124
123
|
"execa": "5.1.1",
|
|
125
124
|
"fs-extra": "11.x",
|
|
126
|
-
"glob": "^
|
|
125
|
+
"glob": "^9.3.2",
|
|
127
126
|
"glob-gitignore": "latest",
|
|
128
127
|
"husky": "4.x",
|
|
129
|
-
"jest": "^29.
|
|
128
|
+
"jest": "^29.5.0",
|
|
130
129
|
"jest-snapshot-serializer-raw": "^1.2.0",
|
|
131
130
|
"js-yaml": "latest",
|
|
132
|
-
"json-schema-to-typescript": "^
|
|
131
|
+
"json-schema-to-typescript": "^12.0.0",
|
|
133
132
|
"lint-staged": "latest",
|
|
134
133
|
"lodash.camelcase": "^4.3.0",
|
|
135
134
|
"lodash.set": "^4.3.2",
|
|
136
|
-
"node-fetch": "^3.3.
|
|
137
|
-
"prettier": "^2.8.
|
|
138
|
-
"typescript": "~
|
|
135
|
+
"node-fetch": "^3.3.1",
|
|
136
|
+
"prettier": "^2.8.7",
|
|
137
|
+
"typescript": "~5.0.2"
|
|
139
138
|
},
|
|
140
139
|
"lint-staged": {
|
|
141
140
|
"*.{ts,tsx,js,jsx}": [
|