ts-jest 28.0.4 → 28.0.7
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 +29 -0
- package/dist/legacy/compiler/ts-compiler.d.ts +2 -2
- package/dist/legacy/compiler/ts-compiler.js +41 -31
- package/dist/legacy/compiler/ts-jest-compiler.d.ts +2 -3
- package/dist/legacy/config/config-set.js +10 -5
- package/dist/legacy/ts-jest-transformer.js +18 -10
- package/dist/types.d.ts +4 -1
- package/globals.d.ts +18 -0
- package/package.json +20 -16
- package/renovate.json +0 -68
package/.ts-jest-digest
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ff200d704e5e12be15a3c37d51a6bd3bb025a6c5
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## [28.0.7](https://github.com/kulshekhar/ts-jest/compare/v28.0.6...v28.0.7) (2022-07-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update `@jest/types` to be an optional peer dependency ([#3690](https://github.com/kulshekhar/ts-jest/issues/3690)) ([8a8c3fa](https://github.com/kulshekhar/ts-jest/commit/8a8c3fafecffd19380171c661e94246024cae2ff)), closes [#3689](https://github.com/kulshekhar/ts-jest/issues/3689)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [28.0.6](https://github.com/kulshekhar/ts-jest/compare/v28.0.5...v28.0.6) (2022-07-13)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **config:** don't show diagnostics warning with `diagnostics: false` ([#3647](https://github.com/kulshekhar/ts-jest/issues/3647)) ([9a9bc02](https://github.com/kulshekhar/ts-jest/commit/9a9bc02935968fb5eb9fd3614a1f7cce019b80d8)), closes [#3638](https://github.com/kulshekhar/ts-jest/issues/3638)
|
|
16
|
+
* **legacy:** add `useCaseSensitiveFileNames` wherever needed ([#3683](https://github.com/kulshekhar/ts-jest/issues/3683)) ([c40bc34](https://github.com/kulshekhar/ts-jest/commit/c40bc34625d63cccc0db7296e616af27868fe1fe)), closes [#3665](https://github.com/kulshekhar/ts-jest/issues/3665)
|
|
17
|
+
* set `@jest/types` as peer dependency ([#3633](https://github.com/kulshekhar/ts-jest/issues/3633)) ([24567e1](https://github.com/kulshekhar/ts-jest/commit/24567e13d2780ad8a11c7ff35f9151ec53f8c211))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## [28.0.5](https://github.com/kulshekhar/ts-jest/compare/v28.0.4...v28.0.5) (2022-06-11)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **legacy:** throw type check error in ESM mode with `reject` ([#3618](https://github.com/kulshekhar/ts-jest/issues/3618)) ([7dd01ff](https://github.com/kulshekhar/ts-jest/commit/7dd01ffe0c7ad3add87b11227964544f2586355a)), closes [#3507](https://github.com/kulshekhar/ts-jest/issues/3507)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
1
30
|
## [28.0.4](https://github.com/kulshekhar/ts-jest/compare/v28.0.3...v28.0.4) (2022-06-02)
|
|
2
31
|
|
|
3
32
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { TransformedSource } from '@jest/transform';
|
|
2
1
|
import { Logger } from 'bs-logger';
|
|
3
2
|
import type { CompilerOptions, CustomTransformers, Program, TranspileOutput } from 'typescript';
|
|
4
3
|
import type { StringMap, TsCompilerInstance, TsJestAstTransformer, TsJestCompileOptions, TTypeScript } from '../../types';
|
|
4
|
+
import { CompiledOutput } from '../../types';
|
|
5
5
|
import type { ConfigSet } from '../config/config-set';
|
|
6
6
|
export declare class TsCompiler implements TsCompilerInstance {
|
|
7
7
|
readonly configSet: ConfigSet;
|
|
@@ -15,7 +15,7 @@ export declare class TsCompiler implements TsCompilerInstance {
|
|
|
15
15
|
program: Program | undefined;
|
|
16
16
|
constructor(configSet: ConfigSet, runtimeCacheFS: StringMap);
|
|
17
17
|
getResolvedModules(fileContent: string, fileName: string, runtimeCacheFS: StringMap): string[];
|
|
18
|
-
getCompiledOutput(fileContent: string, fileName: string, options: TsJestCompileOptions):
|
|
18
|
+
getCompiledOutput(fileContent: string, fileName: string, options: TsJestCompileOptions): CompiledOutput;
|
|
19
19
|
protected _transpileOutput(fileContent: string, fileName: string): TranspileOutput;
|
|
20
20
|
protected _makeTransformers(customTransformers: TsJestAstTransformer): CustomTransformers;
|
|
21
21
|
}
|
|
@@ -87,8 +87,9 @@ var TsCompiler = (function () {
|
|
|
87
87
|
getCurrentDirectory: function () { return _this.configSet.cwd; },
|
|
88
88
|
realpath: this._ts.sys.realpath && (0, lodash_memoize_1.default)(this._ts.sys.realpath),
|
|
89
89
|
getDirectories: (0, lodash_memoize_1.default)(this._ts.sys.getDirectories),
|
|
90
|
+
useCaseSensitiveFileNames: function () { return _this._ts.sys.useCaseSensitiveFileNames; },
|
|
90
91
|
};
|
|
91
|
-
this._moduleResolutionCache = this._ts.createModuleResolutionCache(this.configSet.cwd, function (x) { return x; }, this._compilerOptions);
|
|
92
|
+
this._moduleResolutionCache = this._ts.createModuleResolutionCache(this.configSet.cwd, this._ts.sys.useCaseSensitiveFileNames ? function (x) { return x; } : function (x) { return x.toLowerCase(); }, this._compilerOptions);
|
|
92
93
|
this._createLanguageService();
|
|
93
94
|
}
|
|
94
95
|
}
|
|
@@ -107,10 +108,12 @@ var TsCompiler = (function () {
|
|
|
107
108
|
return importedModulePaths;
|
|
108
109
|
};
|
|
109
110
|
TsCompiler.prototype.getCompiledOutput = function (fileContent, fileName, options) {
|
|
111
|
+
var e_1, _a;
|
|
110
112
|
var moduleKind = this._initialCompilerOptions.module;
|
|
111
113
|
var esModuleInterop = this._initialCompilerOptions.esModuleInterop;
|
|
112
114
|
var allowSyntheticDefaultImports = this._initialCompilerOptions.allowSyntheticDefaultImports;
|
|
113
115
|
var currentModuleKind = this._compilerOptions.module;
|
|
116
|
+
var isEsmMode = this.configSet.useESM && options.supportsStaticESM;
|
|
114
117
|
if ((this.configSet.babelJestTransformer || (!this.configSet.babelJestTransformer && options.supportsStaticESM)) &&
|
|
115
118
|
this.configSet.useESM) {
|
|
116
119
|
moduleKind =
|
|
@@ -130,7 +133,33 @@ var TsCompiler = (function () {
|
|
|
130
133
|
this._logger.debug({ fileName: fileName }, 'getCompiledOutput(): compiling using language service');
|
|
131
134
|
this._updateMemoryCache(fileContent, fileName, currentModuleKind === moduleKind);
|
|
132
135
|
var output = this._languageService.getEmitOutput(fileName);
|
|
133
|
-
this.
|
|
136
|
+
var diagnostics = this.getDiagnostics(fileName);
|
|
137
|
+
if (!isEsmMode && diagnostics.length) {
|
|
138
|
+
this.configSet.raiseDiagnostics(diagnostics, fileName, this._logger);
|
|
139
|
+
if (options.watchMode) {
|
|
140
|
+
this._logger.debug({ fileName: fileName }, '_doTypeChecking(): starting watch mode computing diagnostics');
|
|
141
|
+
try {
|
|
142
|
+
for (var _b = __values(options.depGraphs.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
143
|
+
var entry = _c.value;
|
|
144
|
+
var normalizedModuleNames = entry[1].resolvedModuleNames.map(function (moduleName) { return (0, path_1.normalize)(moduleName); });
|
|
145
|
+
var fileToReTypeCheck = entry[0];
|
|
146
|
+
if (normalizedModuleNames.includes(fileName) && this.configSet.shouldReportDiagnostics(fileToReTypeCheck)) {
|
|
147
|
+
this._logger.debug({ fileToReTypeCheck: fileToReTypeCheck }, '_doTypeChecking(): computing diagnostics using language service');
|
|
148
|
+
this._updateMemoryCache(this._getFileContentFromCache(fileToReTypeCheck), fileToReTypeCheck);
|
|
149
|
+
var importedModulesDiagnostics = __spreadArray(__spreadArray([], __read(this._languageService.getSemanticDiagnostics(fileToReTypeCheck)), false), __read(this._languageService.getSyntacticDiagnostics(fileToReTypeCheck)), false);
|
|
150
|
+
this.configSet.raiseDiagnostics(importedModulesDiagnostics, fileName, this._logger);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
155
|
+
finally {
|
|
156
|
+
try {
|
|
157
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
158
|
+
}
|
|
159
|
+
finally { if (e_1) throw e_1.error; }
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
134
163
|
if (output.emitSkipped) {
|
|
135
164
|
if (constants_1.TS_TSX_REGEX.test(fileName)) {
|
|
136
165
|
throw new Error((0, messages_1.interpolate)("Unable to process '{{file}}', please make sure that `outDir` in your tsconfig is neither `''` or `'.'`. You can also configure Jest config option `transformIgnorePatterns` to inform `ts-jest` to transform {{file}}", { file: fileName }));
|
|
@@ -151,9 +180,11 @@ var TsCompiler = (function () {
|
|
|
151
180
|
return this._compilerOptions.sourceMap
|
|
152
181
|
? {
|
|
153
182
|
code: (0, compiler_utils_1.updateOutput)(outputFiles[1].text, fileName, outputFiles[0].text),
|
|
183
|
+
diagnostics: diagnostics,
|
|
154
184
|
}
|
|
155
185
|
: {
|
|
156
186
|
code: (0, compiler_utils_1.updateOutput)(outputFiles[0].text, fileName),
|
|
187
|
+
diagnostics: diagnostics,
|
|
157
188
|
};
|
|
158
189
|
}
|
|
159
190
|
else {
|
|
@@ -191,10 +222,12 @@ var TsCompiler = (function () {
|
|
|
191
222
|
};
|
|
192
223
|
TsCompiler.prototype._createLanguageService = function () {
|
|
193
224
|
var _this = this;
|
|
225
|
+
var _a;
|
|
194
226
|
this._parsedTsConfig.fileNames
|
|
195
227
|
.filter(function (fileName) { return constants_1.TS_TSX_REGEX.test(fileName) && !_this.configSet.isTestFile(fileName); })
|
|
196
228
|
.forEach(function (fileName) { return _this._fileVersionCache.set(fileName, 0); });
|
|
197
229
|
var serviceHost = {
|
|
230
|
+
useCaseSensitiveFileNames: function () { return _this._ts.sys.useCaseSensitiveFileNames; },
|
|
198
231
|
getProjectVersion: function () { return String(_this._projectVersion); },
|
|
199
232
|
getScriptFileNames: function () { return __spreadArray([], __read(_this._fileVersionCache.keys()), false); },
|
|
200
233
|
getScriptVersion: function (fileName) {
|
|
@@ -220,7 +253,7 @@ var TsCompiler = (function () {
|
|
|
220
253
|
return _this._ts.ScriptSnapshot.fromString(contents);
|
|
221
254
|
},
|
|
222
255
|
fileExists: (0, lodash_memoize_1.default)(this._ts.sys.fileExists),
|
|
223
|
-
readFile: this._cachedReadFile,
|
|
256
|
+
readFile: (_a = this._cachedReadFile) !== null && _a !== void 0 ? _a : this._ts.sys.readFile,
|
|
224
257
|
readDirectory: (0, lodash_memoize_1.default)(this._ts.sys.readDirectory),
|
|
225
258
|
getDirectories: (0, lodash_memoize_1.default)(this._ts.sys.getDirectories),
|
|
226
259
|
directoryExists: (0, lodash_memoize_1.default)(this._ts.sys.directoryExists),
|
|
@@ -235,7 +268,7 @@ var TsCompiler = (function () {
|
|
|
235
268
|
},
|
|
236
269
|
};
|
|
237
270
|
this._logger.debug('created language service');
|
|
238
|
-
this._languageService = this._ts.createLanguageService(serviceHost, this._ts.createDocumentRegistry());
|
|
271
|
+
this._languageService = this._ts.createLanguageService(serviceHost, this._ts.createDocumentRegistry(this._ts.sys.useCaseSensitiveFileNames, this.configSet.cwd));
|
|
239
272
|
this.program = this._languageService.getProgram();
|
|
240
273
|
};
|
|
241
274
|
TsCompiler.prototype._getFileContentFromCache = function (filePath) {
|
|
@@ -290,36 +323,13 @@ var TsCompiler = (function () {
|
|
|
290
323
|
if (shouldIncrementProjectVersion)
|
|
291
324
|
this._projectVersion++;
|
|
292
325
|
};
|
|
293
|
-
TsCompiler.prototype.
|
|
294
|
-
var
|
|
326
|
+
TsCompiler.prototype.getDiagnostics = function (fileName) {
|
|
327
|
+
var diagnostics = [];
|
|
295
328
|
if (this.configSet.shouldReportDiagnostics(fileName)) {
|
|
296
329
|
this._logger.debug({ fileName: fileName }, '_doTypeChecking(): computing diagnostics using language service');
|
|
297
|
-
|
|
298
|
-
this.configSet.raiseDiagnostics(diagnostics, fileName, this._logger);
|
|
299
|
-
}
|
|
300
|
-
if (watchMode) {
|
|
301
|
-
this._logger.debug({ fileName: fileName }, '_doTypeChecking(): starting watch mode computing diagnostics');
|
|
302
|
-
try {
|
|
303
|
-
for (var _b = __values(depGraphs.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
304
|
-
var entry = _c.value;
|
|
305
|
-
var normalizedModuleNames = entry[1].resolvedModuleNames.map(function (moduleName) { return (0, path_1.normalize)(moduleName); });
|
|
306
|
-
var fileToReTypeCheck = entry[0];
|
|
307
|
-
if (normalizedModuleNames.includes(fileName) && this.configSet.shouldReportDiagnostics(fileToReTypeCheck)) {
|
|
308
|
-
this._logger.debug({ fileToReTypeCheck: fileToReTypeCheck }, '_doTypeChecking(): computing diagnostics using language service');
|
|
309
|
-
this._updateMemoryCache(this._getFileContentFromCache(fileToReTypeCheck), fileToReTypeCheck);
|
|
310
|
-
var importedModulesDiagnostics = __spreadArray(__spreadArray([], __read(this._languageService.getSemanticDiagnostics(fileToReTypeCheck)), false), __read(this._languageService.getSyntacticDiagnostics(fileToReTypeCheck)), false);
|
|
311
|
-
this.configSet.raiseDiagnostics(importedModulesDiagnostics, fileName, this._logger);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
316
|
-
finally {
|
|
317
|
-
try {
|
|
318
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
319
|
-
}
|
|
320
|
-
finally { if (e_1) throw e_1.error; }
|
|
321
|
-
}
|
|
330
|
+
diagnostics.push.apply(diagnostics, __spreadArray(__spreadArray([], __read(this._languageService.getSemanticDiagnostics(fileName)), false), __read(this._languageService.getSyntacticDiagnostics(fileName)), false));
|
|
322
331
|
}
|
|
332
|
+
return diagnostics;
|
|
323
333
|
};
|
|
324
334
|
return TsCompiler;
|
|
325
335
|
}());
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CompilerInstance, StringMap, TsJestCompileOptions } from '../../types';
|
|
1
|
+
import type { CompilerInstance, CompiledOutput, StringMap, TsJestCompileOptions } from '../../types';
|
|
3
2
|
import type { ConfigSet } from '../config/config-set';
|
|
4
3
|
export declare class TsJestCompiler implements CompilerInstance {
|
|
5
4
|
private readonly _compilerInstance;
|
|
6
5
|
constructor(configSet: ConfigSet, runtimeCacheFS: StringMap);
|
|
7
6
|
getResolvedModules(fileContent: string, fileName: string, runtimeCacheFS: StringMap): string[];
|
|
8
|
-
getCompiledOutput(fileContent: string, fileName: string, options: TsJestCompileOptions):
|
|
7
|
+
getCompiledOutput(fileContent: string, fileName: string, options: TsJestCompileOptions): CompiledOutput;
|
|
9
8
|
}
|
|
@@ -247,9 +247,14 @@ var ConfigSet = (function () {
|
|
|
247
247
|
throws: diagnosticsOpt,
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
if (diagnosticsOpt) {
|
|
251
|
+
this._shouldIgnoreDiagnosticsForFile = this._diagnostics.exclude.length
|
|
252
|
+
? (0, jest_util_1.globsToMatcher)(this._diagnostics.exclude)
|
|
253
|
+
: function () { return false; };
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
this._shouldIgnoreDiagnosticsForFile = function () { return true; };
|
|
257
|
+
}
|
|
253
258
|
this.logger.debug({ diagnostics: this._diagnostics }, 'normalized diagnostics config via ts-jest option');
|
|
254
259
|
var tsconfigOpt = options.tsconfig;
|
|
255
260
|
var configFilePath = typeof tsconfigOpt === 'string' ? this.resolvePath(tsconfigOpt) : undefined;
|
|
@@ -457,7 +462,7 @@ var ConfigSet = (function () {
|
|
|
457
462
|
});
|
|
458
463
|
if (!filteredDiagnostics.length)
|
|
459
464
|
return;
|
|
460
|
-
var error = this.
|
|
465
|
+
var error = this.createTsError(filteredDiagnostics);
|
|
461
466
|
var importantCategories = [DiagnosticCategory.Warning, DiagnosticCategory.Error];
|
|
462
467
|
if (this._diagnostics.throws && filteredDiagnostics.some(function (d) { return importantCategories.includes(d.category); })) {
|
|
463
468
|
throw error;
|
|
@@ -470,7 +475,7 @@ var ConfigSet = (function () {
|
|
|
470
475
|
? this.parsedTsConfig.options.checkJs && !this._shouldIgnoreDiagnosticsForFile(filePath)
|
|
471
476
|
: !this._shouldIgnoreDiagnosticsForFile(filePath);
|
|
472
477
|
};
|
|
473
|
-
ConfigSet.prototype.
|
|
478
|
+
ConfigSet.prototype.createTsError = function (diagnostics) {
|
|
474
479
|
var _this = this;
|
|
475
480
|
var formatDiagnostics = this._diagnostics.pretty
|
|
476
481
|
? this.compilerModule.formatDiagnosticsWithColorAndContext
|
|
@@ -157,7 +157,9 @@ var TsJestTransformer = (function () {
|
|
|
157
157
|
var configs = this._configsFor(transformOptions);
|
|
158
158
|
var shouldStringifyContent = configs.shouldStringifyContent(sourcePath);
|
|
159
159
|
var babelJest = shouldStringifyContent ? undefined : configs.babelJestTransformer;
|
|
160
|
-
var result =
|
|
160
|
+
var result = {
|
|
161
|
+
code: this.processWithTs(sourceText, sourcePath, transformOptions).code,
|
|
162
|
+
};
|
|
161
163
|
if (babelJest) {
|
|
162
164
|
this._logger.debug({ fileName: sourcePath }, 'calling babel-jest processor');
|
|
163
165
|
result = babelJest.process(result.code, sourcePath, __assign(__assign({}, transformOptions), { instrument: false }));
|
|
@@ -170,21 +172,28 @@ var TsJestTransformer = (function () {
|
|
|
170
172
|
var _this = this;
|
|
171
173
|
return __generator(this, function (_a) {
|
|
172
174
|
this._logger.debug({ fileName: sourcePath, transformOptions: transformOptions }, 'processing', sourcePath);
|
|
173
|
-
return [2, new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
|
|
174
|
-
var configs, shouldStringifyContent, babelJest, result;
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
return [2, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
176
|
+
var configs, shouldStringifyContent, babelJest, result, processWithTsResult;
|
|
177
|
+
var _a;
|
|
178
|
+
return __generator(this, function (_b) {
|
|
179
|
+
switch (_b.label) {
|
|
177
180
|
case 0:
|
|
178
181
|
configs = this._configsFor(transformOptions);
|
|
179
182
|
shouldStringifyContent = configs.shouldStringifyContent(sourcePath);
|
|
180
183
|
babelJest = shouldStringifyContent ? undefined : configs.babelJestTransformer;
|
|
181
|
-
|
|
184
|
+
processWithTsResult = this.processWithTs(sourceText, sourcePath, transformOptions);
|
|
185
|
+
result = {
|
|
186
|
+
code: processWithTsResult.code,
|
|
187
|
+
};
|
|
188
|
+
if ((_a = processWithTsResult.diagnostics) === null || _a === void 0 ? void 0 : _a.length) {
|
|
189
|
+
reject(configs.createTsError(processWithTsResult.diagnostics));
|
|
190
|
+
}
|
|
182
191
|
if (!babelJest) return [3, 2];
|
|
183
192
|
this._logger.debug({ fileName: sourcePath }, 'calling babel-jest processor');
|
|
184
193
|
return [4, babelJest.processAsync(result.code, sourcePath, __assign(__assign({}, transformOptions), { instrument: false }))];
|
|
185
194
|
case 1:
|
|
186
|
-
result =
|
|
187
|
-
|
|
195
|
+
result = _b.sent();
|
|
196
|
+
_b.label = 2;
|
|
188
197
|
case 2:
|
|
189
198
|
result = this.runTsJestHook(sourcePath, sourceText, transformOptions, result);
|
|
190
199
|
resolve(result);
|
|
@@ -292,9 +301,8 @@ var TsJestTransformer = (function () {
|
|
|
292
301
|
};
|
|
293
302
|
TsJestTransformer.prototype.getCacheKeyAsync = function (sourceText, sourcePath, transformOptions) {
|
|
294
303
|
return __awaiter(this, void 0, void 0, function () {
|
|
295
|
-
var _this = this;
|
|
296
304
|
return __generator(this, function (_a) {
|
|
297
|
-
return [2,
|
|
305
|
+
return [2, Promise.resolve(this.getCacheKey(sourceText, sourcePath, transformOptions))];
|
|
298
306
|
});
|
|
299
307
|
});
|
|
300
308
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -79,9 +79,12 @@ export interface TsJestCompileOptions {
|
|
|
79
79
|
watchMode: boolean;
|
|
80
80
|
supportsStaticESM: boolean;
|
|
81
81
|
}
|
|
82
|
+
export interface CompiledOutput extends TransformedSource {
|
|
83
|
+
diagnostics?: _ts.Diagnostic[];
|
|
84
|
+
}
|
|
82
85
|
export interface CompilerInstance {
|
|
83
86
|
getResolvedModules(fileContent: string, fileName: string, runtimeCacheFS: StringMap): string[];
|
|
84
|
-
getCompiledOutput(fileContent: string, fileName: string, options: TsJestCompileOptions):
|
|
87
|
+
getCompiledOutput(fileContent: string, fileName: string, options: TsJestCompileOptions): CompiledOutput;
|
|
85
88
|
}
|
|
86
89
|
export interface TsCompilerInstance extends CompilerInstance {
|
|
87
90
|
configSet: ConfigSet;
|
package/globals.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
const beforeAll: typeof import('@jest/globals').beforeAll
|
|
3
|
+
const beforeEach: typeof import('@jest/globals').beforeEach
|
|
4
|
+
const afterAll: typeof import('@jest/globals').afterAll
|
|
5
|
+
const afterEach: typeof import('@jest/globals').afterEach
|
|
6
|
+
const describe: typeof import('@jest/globals').describe
|
|
7
|
+
const fdescribe: typeof import('@jest/globals').fdescribe
|
|
8
|
+
const xdescribe: typeof import('@jest/globals').xdescribe
|
|
9
|
+
const it: typeof import('@jest/globals').it
|
|
10
|
+
const fit: typeof import('@jest/globals').fit
|
|
11
|
+
const xit: typeof import('@jest/globals').xit
|
|
12
|
+
const test: typeof import('@jest/globals').test
|
|
13
|
+
const xtest: typeof import('@jest/globals').xtest
|
|
14
|
+
const expect: typeof import('@jest/globals').expect
|
|
15
|
+
const jest: typeof import('@jest/globals').jest
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-jest",
|
|
3
|
-
"version": "28.0.
|
|
3
|
+
"version": "28.0.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -58,10 +58,11 @@
|
|
|
58
58
|
"lodash.memoize": "4.x",
|
|
59
59
|
"make-error": "1.x",
|
|
60
60
|
"semver": "7.x",
|
|
61
|
-
"yargs-parser": "^
|
|
61
|
+
"yargs-parser": "^21.0.1"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@babel/core": ">=7.0.0-beta.0 <8",
|
|
65
|
+
"@jest/types": "^28.0.0",
|
|
65
66
|
"babel-jest": "^28.0.0",
|
|
66
67
|
"jest": "^28.0.0",
|
|
67
68
|
"typescript": ">=4.3"
|
|
@@ -70,6 +71,9 @@
|
|
|
70
71
|
"@babel/core": {
|
|
71
72
|
"optional": true
|
|
72
73
|
},
|
|
74
|
+
"@jest/types": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
73
77
|
"babel-jest": {
|
|
74
78
|
"optional": true
|
|
75
79
|
},
|
|
@@ -86,13 +90,12 @@
|
|
|
86
90
|
},
|
|
87
91
|
"devDependencies": {
|
|
88
92
|
"@commitlint/cli": "17.x",
|
|
89
|
-
"@commitlint/config-angular": "^17.0.
|
|
90
|
-
"@jest/transform": "^28.
|
|
91
|
-
"@jest/types": "^28.
|
|
93
|
+
"@commitlint/config-angular": "^17.0.3",
|
|
94
|
+
"@jest/transform": "^28.1.1",
|
|
95
|
+
"@jest/types": "^28.1.1",
|
|
92
96
|
"@types/babel__core": "7.x",
|
|
93
97
|
"@types/cross-spawn": "latest",
|
|
94
98
|
"@types/fs-extra": "latest",
|
|
95
|
-
"@types/jest": "^27.0.3",
|
|
96
99
|
"@types/js-yaml": "latest",
|
|
97
100
|
"@types/lodash.camelcase": "4.x",
|
|
98
101
|
"@types/lodash.memoize": "4.x",
|
|
@@ -104,13 +107,14 @@
|
|
|
104
107
|
"@types/rimraf": "^3.0.2",
|
|
105
108
|
"@types/semver": "latest",
|
|
106
109
|
"@types/yargs": "latest",
|
|
107
|
-
"@types/yargs-parser": "
|
|
108
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
109
|
-
"@typescript-eslint/parser": "^5.
|
|
110
|
+
"@types/yargs-parser": "21.x",
|
|
111
|
+
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
|
112
|
+
"@typescript-eslint/parser": "^5.30.6",
|
|
113
|
+
"babel-jest": "^28.1.1",
|
|
110
114
|
"conventional-changelog-cli": "2.x",
|
|
111
115
|
"cross-spawn": "latest",
|
|
112
|
-
"esbuild": "~0.14.
|
|
113
|
-
"eslint": "^8.
|
|
116
|
+
"esbuild": "~0.14.49",
|
|
117
|
+
"eslint": "^8.19.0",
|
|
114
118
|
"eslint-config-prettier": "latest",
|
|
115
119
|
"eslint-plugin-import": "latest",
|
|
116
120
|
"eslint-plugin-jest": "latest",
|
|
@@ -122,16 +126,16 @@
|
|
|
122
126
|
"glob": "^8.0.3",
|
|
123
127
|
"glob-gitignore": "latest",
|
|
124
128
|
"husky": "4.x",
|
|
125
|
-
"jest": "^28.
|
|
129
|
+
"jest": "^28.1.1",
|
|
126
130
|
"jest-snapshot-serializer-raw": "^1.2.0",
|
|
127
131
|
"js-yaml": "latest",
|
|
128
|
-
"json-schema-to-typescript": "^
|
|
132
|
+
"json-schema-to-typescript": "^11.0.1",
|
|
129
133
|
"lint-staged": "latest",
|
|
130
134
|
"lodash.camelcase": "^4.3.0",
|
|
131
135
|
"lodash.set": "^4.3.2",
|
|
132
|
-
"node-fetch": "^3.
|
|
133
|
-
"prettier": "^2.
|
|
134
|
-
"typescript": "~4.
|
|
136
|
+
"node-fetch": "^3.2.8",
|
|
137
|
+
"prettier": "^2.7.1",
|
|
138
|
+
"typescript": "~4.7.4"
|
|
135
139
|
},
|
|
136
140
|
"lint-staged": {
|
|
137
141
|
"*.{ts,tsx,js,jsx}": [
|
package/renovate.json
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
":dependencyDashboard",
|
|
4
|
-
"group:babelMonorepo",
|
|
5
|
-
"group:commitlintMonorepo",
|
|
6
|
-
"group:docusaurusMonorepo",
|
|
7
|
-
":prHourlyLimit2",
|
|
8
|
-
"workarounds:all"
|
|
9
|
-
],
|
|
10
|
-
"timezone": "UTC",
|
|
11
|
-
"rangeStrategy": "bump",
|
|
12
|
-
"separateMajorMinor": true,
|
|
13
|
-
"prConcurrentLimit": 2,
|
|
14
|
-
"semanticCommits": "enabled",
|
|
15
|
-
"commitMessagePrefix": "build(deps):",
|
|
16
|
-
"ignorePaths": ["examples/react-app"],
|
|
17
|
-
"ignoreDeps": [
|
|
18
|
-
"@mdx-js/react",
|
|
19
|
-
"@types/react",
|
|
20
|
-
"execa",
|
|
21
|
-
"chalk",
|
|
22
|
-
"husky"
|
|
23
|
-
],
|
|
24
|
-
"packageRules": [
|
|
25
|
-
{
|
|
26
|
-
"matchPaths": ["examples/**"],
|
|
27
|
-
"matchUpdateTypes": ["major"],
|
|
28
|
-
"enabled": false
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"matchPaths": ["examples/react-app"],
|
|
32
|
-
"enabled": false
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"matchPaths": ["package.json"],
|
|
36
|
-
"matchPackagePatterns": ["jest"],
|
|
37
|
-
"excludePackageNames": ["eslint-plugin-jest"],
|
|
38
|
-
"matchUpdateTypes": ["patch", "minor"],
|
|
39
|
-
"groupName": "Jest packages"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"extends": ["packages:eslint"],
|
|
43
|
-
"groupName": "ESLint packages"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"matchPackagePrefixes": ["esbuild"],
|
|
47
|
-
"groupName": "Esbuild packages"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"matchFiles": ["package.json"],
|
|
51
|
-
"matchDepTypes": ["dependencies", "optionalDependencies"],
|
|
52
|
-
"rangeStrategy": "in-range-only"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"matchPaths": ["e2e/**"],
|
|
56
|
-
"matchPackageNames": [
|
|
57
|
-
"react",
|
|
58
|
-
"react-intl"
|
|
59
|
-
],
|
|
60
|
-
"groupName": "React e2e packages",
|
|
61
|
-
"enabled": true
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"matchDepTypes": ["peerDependencies"],
|
|
65
|
-
"enabled": false
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
}
|