ts-jest 24.3.0 → 25.2.1
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 +54 -0
- package/README.md +1 -1
- package/dist/compiler.js +12 -0
- package/dist/config/config-set.d.ts +3 -4
- package/dist/config/config-set.js +9 -28
- package/dist/config/create-jest-preset.d.ts +3 -3
- package/dist/transformers/hoist-jest.js +9 -8
- package/dist/ts-jest-transformer.d.ts +5 -4
- package/dist/types.d.ts +5 -8
- package/dist/util/importer.js +8 -3
- package/dist/util/version-checkers.js +2 -2
- package/package.json +15 -8
package/.ts-jest-digest
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
6982d3f1883cd9adc2334b36b70c6625ec327569
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
|
1
|
+
<a name="25.2.1"></a>
|
|
2
|
+
## [25.2.1](https://github.com/kulshekhar/ts-jest/compare/v25.2.0...v25.2.1) (2020-02-19)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **compiler:** allow transformation of typescript files in node_modules ([#1385](https://github.com/kulshekhar/ts-jest/issues/1385)) ([814405e](https://github.com/kulshekhar/ts-jest/commit/814405e))
|
|
8
|
+
* **transformer:** add deepUnmock to hoist method list ([#1372](https://github.com/kulshekhar/ts-jest/issues/1372)) ([0fbbc00](https://github.com/kulshekhar/ts-jest/commit/0fbbc00))
|
|
9
|
+
* **util:** use resolve package typescript package in yarn workspaces ([#1377](https://github.com/kulshekhar/ts-jest/issues/1377)) ([a63808c](https://github.com/kulshekhar/ts-jest/commit/a63808c))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<a name="25.2.0"></a>
|
|
14
|
+
# [25.2.0](https://github.com/kulshekhar/ts-jest/compare/v25.1.0...v25.2.0) (2020-02-03)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **config:** comment out unused codes ([dff1332](https://github.com/kulshekhar/ts-jest/commit/dff1332))
|
|
20
|
+
* **config:** pass plain config object to babel-jest transformer ([e0895da](https://github.com/kulshekhar/ts-jest/commit/e0895da))
|
|
21
|
+
* **config:** remove unused codes ([7aa3928](https://github.com/kulshekhar/ts-jest/commit/7aa3928))
|
|
22
|
+
* **config:** remove unused import ([81897e1](https://github.com/kulshekhar/ts-jest/commit/81897e1))
|
|
23
|
+
* **test:** improve unit tests for babel config ([ebd9380](https://github.com/kulshekhar/ts-jest/commit/ebd9380))
|
|
24
|
+
* **test:** update snapshot ([0e1190d](https://github.com/kulshekhar/ts-jest/commit/0e1190d))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
<a name="25.1.0"></a>
|
|
29
|
+
# [25.1.0](https://github.com/kulshekhar/ts-jest/compare/v25.0.0...v25.1.0) (2020-01-30)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* jest 25 type definitions ([ba82a9e](https://github.com/kulshekhar/ts-jest/commit/ba82a9e))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
<a name="25.0.0"></a>
|
|
39
|
+
# [25.0.0](https://github.com/kulshekhar/ts-jest/compare/v24.3.0...v25.0.0) (2020-01-23)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* Fix tests for version checks v2 ([154f1d6](https://github.com/kulshekhar/ts-jest/commit/154f1d6))
|
|
45
|
+
* Try to fix snapshots ([ea0ea50](https://github.com/kulshekhar/ts-jest/commit/ea0ea50))
|
|
46
|
+
* Try to fix snapshots v2 ([82445bb](https://github.com/kulshekhar/ts-jest/commit/82445bb))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
* support Jest 25 ([ffc2cfe](https://github.com/kulshekhar/ts-jest/commit/ffc2cfe))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
1
55
|
<a name="24.3.0"></a>
|
|
2
56
|
# [24.3.0](https://github.com/kulshekhar/ts-jest/compare/v24.2.0...v24.3.0) (2020-01-07)
|
|
3
57
|
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ It supports all features of TypeScript including type-checking. [Read more about
|
|
|
13
13
|
|
|
14
14
|
[<img src="./docs/assets/img/documentation.png" align="left" height="24"> View the online documentation (usage & technical)](https://kulshekhar.github.io/ts-jest)
|
|
15
15
|
|
|
16
|
-
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://
|
|
16
|
+
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://join.slack.com/t/ts-jest/shared_invite/enQtNDE1ODQ0OTEzMTczLWI5NTQ4ZmEzOTYxYzM2NjhiZDM2ZTI3MGYyYjA2Y2E1YTMxMjUyYTcxNTlmNjAyZTc2Nzk4YTRmZmRhYmZmYTg)
|
|
17
17
|
|
|
18
18
|
<!--
|
|
19
19
|
[<img src="./docs/assets/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](https://kulshekhar.github.io/ts-jest/user/troubleshooting)
|
package/dist/compiler.js
CHANGED
|
@@ -42,6 +42,7 @@ var bs_logger_1 = require("bs-logger");
|
|
|
42
42
|
var bufferFrom = require("buffer-from");
|
|
43
43
|
var stableStringify = require("fast-json-stable-stringify");
|
|
44
44
|
var fs_1 = require("fs");
|
|
45
|
+
var build_1 = require("jest-config/build");
|
|
45
46
|
var memoize = require("lodash.memoize");
|
|
46
47
|
var mkdirp = require("mkdirp");
|
|
47
48
|
var path_1 = require("path");
|
|
@@ -112,6 +113,10 @@ function createCompiler(configs) {
|
|
|
112
113
|
_b.call = null,
|
|
113
114
|
_b);
|
|
114
115
|
var serviceHostTraceCtx = __assign(__assign({}, serviceHostDebugCtx), (_c = {}, _c[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace, _c));
|
|
116
|
+
var transformIgnorePattern = (configs.jest.transformIgnorePatterns || build_1.defaults.transformIgnorePatterns)
|
|
117
|
+
.map(function (pattern) { return build_1.replaceRootDirInPath(configs.rootDir, pattern); })
|
|
118
|
+
.join('|');
|
|
119
|
+
var transformIgnoreRegExp_1 = new RegExp(transformIgnorePattern);
|
|
115
120
|
var serviceHost = {
|
|
116
121
|
getScriptFileNames: function () { return Object.keys(memoryCache.versions); },
|
|
117
122
|
getScriptVersion: function (fileName) {
|
|
@@ -161,6 +166,13 @@ function createCompiler(configs) {
|
|
|
161
166
|
if (output.emitSkipped) {
|
|
162
167
|
throw new TypeError(path_1.relative(cwd, fileName) + ": Emit skipped");
|
|
163
168
|
}
|
|
169
|
+
if (output.outputFiles.length === 0 && !transformIgnoreRegExp_1.test(fileName)) {
|
|
170
|
+
var normalizedFileName = path_1.normalize(fileName);
|
|
171
|
+
if (!hasOwn.call(memoryCache.versions, normalizedFileName)) {
|
|
172
|
+
memoryCache.versions[normalizedFileName] = 0;
|
|
173
|
+
}
|
|
174
|
+
output = service_1.getEmitOutput(fileName);
|
|
175
|
+
}
|
|
164
176
|
if (output.outputFiles.length === 0) {
|
|
165
177
|
throw new TypeError(messages_1.interpolate(messages_1.Errors.UnableToRequireDefinitionFile, {
|
|
166
178
|
file: path_1.basename(fileName),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { Config } from '@jest/types';
|
|
2
2
|
import { Logger } from 'bs-logger';
|
|
3
3
|
import { CompilerOptions, CustomTransformers, ParsedCommandLine } from 'typescript';
|
|
4
4
|
import { AstTransformerDesc, BabelConfig, BabelJestTransformer, TTypeScript, TsCompiler, TsJestConfig, TsJestGlobalOptions, TsJestHooksMap } from '../types';
|
|
@@ -6,12 +6,11 @@ export declare class ConfigSet {
|
|
|
6
6
|
readonly parentOptions?: TsJestGlobalOptions | undefined;
|
|
7
7
|
get projectPackageJson(): Record<string, any>;
|
|
8
8
|
get projectDependencies(): Record<string, string>;
|
|
9
|
-
get jest():
|
|
9
|
+
get jest(): Config.ProjectConfig;
|
|
10
10
|
get tsJest(): TsJestConfig;
|
|
11
11
|
get typescript(): ParsedCommandLine;
|
|
12
12
|
get tsconfig(): any;
|
|
13
13
|
get versions(): Record<string, string>;
|
|
14
|
-
private static loadConfig;
|
|
15
14
|
get babel(): BabelConfig | undefined;
|
|
16
15
|
get compilerModule(): TTypeScript;
|
|
17
16
|
get babelJestTransformer(): BabelJestTransformer | undefined;
|
|
@@ -28,7 +27,7 @@ export declare class ConfigSet {
|
|
|
28
27
|
get tsJestDigest(): string;
|
|
29
28
|
get cacheKey(): string;
|
|
30
29
|
readonly logger: Logger;
|
|
31
|
-
constructor(jestConfig:
|
|
30
|
+
constructor(jestConfig: Config.ProjectConfig, parentOptions?: TsJestGlobalOptions | undefined, parentLogger?: Logger);
|
|
32
31
|
resolvePath(inputPath: string, { throwIfMissing, nodeResolve }?: {
|
|
33
32
|
throwIfMissing?: boolean;
|
|
34
33
|
nodeResolve?: boolean;
|
|
@@ -52,7 +52,6 @@ var bs_logger_1 = require("bs-logger");
|
|
|
52
52
|
var fs_1 = require("fs");
|
|
53
53
|
var json5 = require("json5");
|
|
54
54
|
var path_1 = require("path");
|
|
55
|
-
var semver = require("semver");
|
|
56
55
|
var __1 = require("..");
|
|
57
56
|
var compiler_1 = require("../compiler");
|
|
58
57
|
var transformers_1 = require("../transformers");
|
|
@@ -177,9 +176,10 @@ var ConfigSet = (function () {
|
|
|
177
176
|
});
|
|
178
177
|
Object.defineProperty(ConfigSet.prototype, "jest", {
|
|
179
178
|
get: function () {
|
|
179
|
+
var _a;
|
|
180
180
|
var config = backports_1.backportJestConfig(this.logger, this._jestConfig);
|
|
181
181
|
if (this.parentOptions) {
|
|
182
|
-
var globals =
|
|
182
|
+
var globals = (_a = config.globals, (_a !== null && _a !== void 0 ? _a : {}));
|
|
183
183
|
globals['ts-jest'] = __assign(__assign({}, this.parentOptions), globals['ts-jest']);
|
|
184
184
|
}
|
|
185
185
|
this.logger.debug({ jestConfig: config }, 'normalized jest config');
|
|
@@ -299,7 +299,8 @@ var ConfigSet = (function () {
|
|
|
299
299
|
modules.push('@babel/core', 'babel-jest');
|
|
300
300
|
}
|
|
301
301
|
return modules.reduce(function (map, name) {
|
|
302
|
-
|
|
302
|
+
var _a;
|
|
303
|
+
map[name] = (_a = get_package_version_1.getPackageVersion(name), (_a !== null && _a !== void 0 ? _a : '-'));
|
|
303
304
|
return map;
|
|
304
305
|
}, { 'ts-jest': __1.version });
|
|
305
306
|
},
|
|
@@ -325,7 +326,7 @@ var ConfigSet = (function () {
|
|
|
325
326
|
return function (diagnostics, filePath, logger) {
|
|
326
327
|
if (logger === void 0) { logger = _this.logger; }
|
|
327
328
|
var filteredDiagnostics = filterDiagnostics(diagnostics, filePath);
|
|
328
|
-
if (filteredDiagnostics.length
|
|
329
|
+
if (!filteredDiagnostics.length)
|
|
329
330
|
return;
|
|
330
331
|
var error = createTsError(filteredDiagnostics);
|
|
331
332
|
var importantCategories = [DiagnosticCategory.Warning, DiagnosticCategory.Error];
|
|
@@ -338,19 +339,6 @@ var ConfigSet = (function () {
|
|
|
338
339
|
enumerable: true,
|
|
339
340
|
configurable: true
|
|
340
341
|
});
|
|
341
|
-
ConfigSet.loadConfig = function (base) {
|
|
342
|
-
var _a = importer_1.importer.babelCore(messages_1.ImportReasons.BabelJest), OptionManager = _a.OptionManager, loadPartialConfig = _a.loadPartialConfig, version = _a.version;
|
|
343
|
-
if (version && semver.satisfies(version, '>=6 <7')) {
|
|
344
|
-
delete base.cwd;
|
|
345
|
-
}
|
|
346
|
-
if (typeof loadPartialConfig === 'function') {
|
|
347
|
-
var partialConfig = loadPartialConfig(base);
|
|
348
|
-
if (partialConfig) {
|
|
349
|
-
return partialConfig.options;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return new OptionManager().init(base);
|
|
353
|
-
};
|
|
354
342
|
Object.defineProperty(ConfigSet.prototype, "babel", {
|
|
355
343
|
get: function () {
|
|
356
344
|
var babelConfig = this.tsJest.babelConfig;
|
|
@@ -372,9 +360,8 @@ var ConfigSet = (function () {
|
|
|
372
360
|
else if (babelConfig.kind === 'inline') {
|
|
373
361
|
base = __assign(__assign({}, base), babelConfig.value);
|
|
374
362
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
return config;
|
|
363
|
+
this.logger.debug({ babelConfig: base }, 'normalized babel config via ts-jest option');
|
|
364
|
+
return base;
|
|
378
365
|
},
|
|
379
366
|
enumerable: true,
|
|
380
367
|
configurable: true
|
|
@@ -440,7 +427,8 @@ var ConfigSet = (function () {
|
|
|
440
427
|
if (filePath && !shouldReportDiagnostic(filePath))
|
|
441
428
|
return [];
|
|
442
429
|
return diagnostics.filter(function (diagnostic) {
|
|
443
|
-
|
|
430
|
+
var _a;
|
|
431
|
+
if (((_a = diagnostic.file) === null || _a === void 0 ? void 0 : _a.fileName) && !shouldReportDiagnostic(diagnostic.file.fileName)) {
|
|
444
432
|
return false;
|
|
445
433
|
}
|
|
446
434
|
return ignoreCodes.indexOf(diagnostic.code) === -1;
|
|
@@ -563,13 +551,6 @@ var ConfigSet = (function () {
|
|
|
563
551
|
enumerable: true,
|
|
564
552
|
configurable: true
|
|
565
553
|
});
|
|
566
|
-
Object.defineProperty(ConfigSet.prototype, "isDoctoring", {
|
|
567
|
-
get: function () {
|
|
568
|
-
return !!process.env.TS_JEST_DOCTOR;
|
|
569
|
-
},
|
|
570
|
-
enumerable: true,
|
|
571
|
-
configurable: true
|
|
572
|
-
});
|
|
573
554
|
Object.defineProperty(ConfigSet.prototype, "tsJestDigest", {
|
|
574
555
|
get: function () {
|
|
575
556
|
return __1.digest;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { Config } from '@jest/types';
|
|
2
2
|
export interface TsJestPresets {
|
|
3
|
-
transform:
|
|
3
|
+
transform: Config.InitialOptions['transform'];
|
|
4
4
|
testMatch?: string[];
|
|
5
5
|
moduleFileExtensions?: string[];
|
|
6
6
|
}
|
|
7
7
|
export interface CreateJestPresetOptions {
|
|
8
8
|
allowJs?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare function createJestPreset({ allowJs }?: CreateJestPresetOptions, from?:
|
|
10
|
+
export declare function createJestPreset({ allowJs }?: CreateJestPresetOptions, from?: Config.InitialOptions): TsJestPresets;
|
|
@@ -21,20 +21,21 @@ var __spread = (this && this.__spread) || function () {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
var bs_logger_1 = require("bs-logger");
|
|
24
|
-
var HOIST_METHODS = ['mock', 'unmock', 'enableAutomock', 'disableAutomock'];
|
|
24
|
+
var HOIST_METHODS = ['mock', 'unmock', 'enableAutomock', 'disableAutomock', 'deepUnmock'];
|
|
25
25
|
exports.name = 'hoisting-jest-mock';
|
|
26
26
|
exports.version = 1;
|
|
27
27
|
function factory(cs) {
|
|
28
28
|
var logger = cs.logger.child({ namespace: 'ts-hoisting' });
|
|
29
29
|
var ts = cs.compilerModule;
|
|
30
|
+
function shouldHoistExpression(expression) {
|
|
31
|
+
return (ts.isCallExpression(expression) &&
|
|
32
|
+
ts.isPropertyAccessExpression(expression.expression) &&
|
|
33
|
+
HOIST_METHODS.includes(expression.expression.name.text) &&
|
|
34
|
+
((ts.isIdentifier(expression.expression.expression) && expression.expression.expression.text === 'jest') ||
|
|
35
|
+
shouldHoistExpression(expression.expression.expression)));
|
|
36
|
+
}
|
|
30
37
|
function shouldHoistNode(node) {
|
|
31
|
-
return
|
|
32
|
-
ts.isCallExpression(node.expression) &&
|
|
33
|
-
ts.isPropertyAccessExpression(node.expression.expression) &&
|
|
34
|
-
ts.isIdentifier(node.expression.expression.expression) &&
|
|
35
|
-
node.expression.expression.expression.text === 'jest' &&
|
|
36
|
-
ts.isIdentifier(node.expression.expression.name) &&
|
|
37
|
-
HOIST_METHODS.includes(node.expression.expression.name.text));
|
|
38
|
+
return ts.isExpressionStatement(node) && shouldHoistExpression(node.expression);
|
|
38
39
|
}
|
|
39
40
|
function createVisitor(ctx, _) {
|
|
40
41
|
var level = 0;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { TransformOptions, TransformedSource, Transformer } from '@jest/transform/build/types';
|
|
2
|
+
import { Config } from '@jest/types';
|
|
2
3
|
import { Logger } from 'bs-logger';
|
|
3
4
|
import { ConfigSet } from './config/config-set';
|
|
4
5
|
import { TsJestGlobalOptions } from './types';
|
|
5
|
-
export declare class TsJestTransformer implements
|
|
6
|
+
export declare class TsJestTransformer implements Transformer {
|
|
6
7
|
static get lastTransformerId(): number;
|
|
7
8
|
readonly logger: Logger;
|
|
8
9
|
readonly id: number;
|
|
9
10
|
readonly options: TsJestGlobalOptions;
|
|
10
11
|
constructor(baseOptions?: TsJestGlobalOptions);
|
|
11
|
-
configsFor(jestConfig:
|
|
12
|
-
process(input: string, filePath:
|
|
12
|
+
configsFor(jestConfig: Config.ProjectConfig | string): ConfigSet;
|
|
13
|
+
process(input: string, filePath: Config.Path, jestConfig: Config.ProjectConfig, transformOptions?: TransformOptions): TransformedSource | string;
|
|
13
14
|
getCacheKey(fileContent: string, filePath: string, jestConfigStr: string, transformOptions?: {
|
|
14
15
|
instrument?: boolean;
|
|
15
16
|
rootDir?: string;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { TransformedSource, Transformer } from '@jest/transform/build/types';
|
|
2
2
|
import * as _babel from 'babel__core';
|
|
3
3
|
import { CompilerOptions, SourceFile, TransformerFactory } from 'typescript';
|
|
4
4
|
import * as _ts from 'typescript';
|
|
5
5
|
import { ConfigSet } from './config/config-set';
|
|
6
6
|
export declare type TBabelCore = typeof _babel;
|
|
7
7
|
export declare type TTypeScript = typeof _ts;
|
|
8
|
-
export declare type TBabelJest = Required<
|
|
8
|
+
export declare type TBabelJest = Required<Transformer>;
|
|
9
9
|
export declare type BabelJestTransformer = {
|
|
10
|
-
[K in Exclude<keyof
|
|
10
|
+
[K in Exclude<keyof Transformer, 'createTransformer'>]: Exclude<Transformer[K], undefined>;
|
|
11
11
|
};
|
|
12
12
|
export declare type BabelConfig = _babel.TransformOptions;
|
|
13
13
|
export interface TsJestGlobalOptions {
|
|
@@ -18,7 +18,7 @@ export interface TsJestGlobalOptions {
|
|
|
18
18
|
astTransformers?: string[];
|
|
19
19
|
diagnostics?: boolean | {
|
|
20
20
|
pretty?: boolean;
|
|
21
|
-
ignoreCodes?: number | string |
|
|
21
|
+
ignoreCodes?: number | string | (number | string)[];
|
|
22
22
|
pathRegex?: RegExp | string;
|
|
23
23
|
warnOnly?: boolean;
|
|
24
24
|
};
|
|
@@ -70,7 +70,7 @@ export interface TsJestConfig {
|
|
|
70
70
|
stringifyContentPathRegex: TsJestConfig$stringifyContentPathRegex;
|
|
71
71
|
}
|
|
72
72
|
export interface TsJestHooksMap {
|
|
73
|
-
afterProcess?(args: any[], result: string |
|
|
73
|
+
afterProcess?(args: any[], result: string | TransformedSource): string | TransformedSource | void;
|
|
74
74
|
}
|
|
75
75
|
export interface TSCommon {
|
|
76
76
|
version: typeof _ts.version;
|
|
@@ -107,7 +107,4 @@ export interface AstTransformerDesc {
|
|
|
107
107
|
version: number;
|
|
108
108
|
factory(cs: ConfigSet): TransformerFactory<SourceFile>;
|
|
109
109
|
}
|
|
110
|
-
export interface IPackageJson {
|
|
111
|
-
main: string;
|
|
112
|
-
}
|
|
113
110
|
export {};
|
package/dist/util/importer.js
CHANGED
|
@@ -177,15 +177,20 @@ function requireWrapper(moduleName) {
|
|
|
177
177
|
}
|
|
178
178
|
var result = { exists: exists, path: path, given: moduleName };
|
|
179
179
|
try {
|
|
180
|
-
result.exports = requireModule(
|
|
180
|
+
result.exports = requireModule(path);
|
|
181
181
|
}
|
|
182
182
|
catch (error) {
|
|
183
|
-
|
|
183
|
+
try {
|
|
184
|
+
result.exports = requireModule(moduleName);
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
result.error = error;
|
|
188
|
+
}
|
|
184
189
|
}
|
|
185
190
|
return result;
|
|
186
191
|
}
|
|
187
192
|
var requireModule = function (mod) { return require(mod); };
|
|
188
|
-
var resolveModule = function (mod) { return require.resolve(mod); };
|
|
193
|
+
var resolveModule = function (mod) { return require.resolve(mod, { paths: [process.cwd(), __dirname] }); };
|
|
189
194
|
function __requireModule(localRequire, localResolve) {
|
|
190
195
|
requireModule = localRequire;
|
|
191
196
|
resolveModule = localResolve;
|
|
@@ -7,9 +7,9 @@ var messages_1 = require("./messages");
|
|
|
7
7
|
var logger = logger_1.rootLogger.child({ namespace: 'versions' });
|
|
8
8
|
var ExpectedVersions;
|
|
9
9
|
(function (ExpectedVersions) {
|
|
10
|
-
ExpectedVersions["Jest"] = ">=
|
|
10
|
+
ExpectedVersions["Jest"] = ">=25 <26";
|
|
11
11
|
ExpectedVersions["TypeScript"] = ">=2.7 <4";
|
|
12
|
-
ExpectedVersions["BabelJest"] = ">=
|
|
12
|
+
ExpectedVersions["BabelJest"] = ">=25 <26";
|
|
13
13
|
ExpectedVersions["BabelCore"] = ">=7.0.0-beta.0 <8";
|
|
14
14
|
})(ExpectedVersions = exports.ExpectedVersions || (exports.ExpectedVersions = {}));
|
|
15
15
|
exports.VersionCheckers = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-jest",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.2.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"bin": "cli.js",
|
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
"test": "run-s -s test:e2e \"test:unit -- {@}\" --",
|
|
16
16
|
"test:prepare": "npm run test:e2e -- --prepareOnly",
|
|
17
17
|
"test:e2e": "node scripts/e2e.js",
|
|
18
|
+
"test:e2e:update-snaphots": "node scripts/e2e.js --updateSnapshot",
|
|
18
19
|
"test:unit": "node_modules/.bin/jest",
|
|
19
20
|
"test:external": "node scripts/test-external-project.js",
|
|
21
|
+
"test:monorepo": "npm run test:external monorepo",
|
|
20
22
|
"lint": "run-s lint:ts lint:js",
|
|
21
23
|
"lint:js": "node_modules/.bin/eslint . -f stylish",
|
|
22
24
|
"lint:ts": "node_modules/.bin/tslint -t stylish --project .",
|
|
@@ -49,7 +51,9 @@
|
|
|
49
51
|
],
|
|
50
52
|
"author": "Kulshekhar Kabra <kulshekhar@users.noreply.github.com> (https://github.com/kulshekhar)",
|
|
51
53
|
"contributors": [
|
|
52
|
-
"Huafu Gandon <huafu.gandon@gmail.com> (https://github.com/huafu)"
|
|
54
|
+
"Huafu Gandon <huafu.gandon@gmail.com> (https://github.com/huafu)",
|
|
55
|
+
"Anh Pham <anhpnnd@gmail.com> (https://github.com/ahnpnl)",
|
|
56
|
+
"Gustav Wengel <gustavwengel@gmail.com> (https://github.com/GeeWee)"
|
|
53
57
|
],
|
|
54
58
|
"license": "MIT",
|
|
55
59
|
"bugs": {
|
|
@@ -60,16 +64,16 @@
|
|
|
60
64
|
"bs-logger": "0.x",
|
|
61
65
|
"buffer-from": "1.x",
|
|
62
66
|
"fast-json-stable-stringify": "2.x",
|
|
63
|
-
"lodash.memoize": "4.x",
|
|
64
67
|
"json5": "2.x",
|
|
68
|
+
"lodash.memoize": "4.x",
|
|
65
69
|
"make-error": "1.x",
|
|
66
70
|
"mkdirp": "0.x",
|
|
67
71
|
"resolve": "1.x",
|
|
68
72
|
"semver": "^5.5",
|
|
69
|
-
"yargs-parser": "
|
|
73
|
+
"yargs-parser": "^16.1.0"
|
|
70
74
|
},
|
|
71
75
|
"peerDependencies": {
|
|
72
|
-
"jest": ">=
|
|
76
|
+
"jest": ">=25 <26"
|
|
73
77
|
},
|
|
74
78
|
"husky": {
|
|
75
79
|
"hooks": {
|
|
@@ -81,11 +85,13 @@
|
|
|
81
85
|
"devDependencies": {
|
|
82
86
|
"@commitlint/cli": "8.x",
|
|
83
87
|
"@commitlint/config-conventional": "7.x",
|
|
88
|
+
"@jest/transform": "25.x",
|
|
89
|
+
"@jest/types": "25.x",
|
|
84
90
|
"@types/babel__core": "7.x",
|
|
85
91
|
"@types/buffer-from": "latest",
|
|
86
92
|
"@types/cross-spawn": "latest",
|
|
87
93
|
"@types/fs-extra": "latest",
|
|
88
|
-
"@types/jest": "
|
|
94
|
+
"@types/jest": "25.x",
|
|
89
95
|
"@types/js-yaml": "latest",
|
|
90
96
|
"@types/json5": "latest",
|
|
91
97
|
"@types/lodash.memoize": "4.x",
|
|
@@ -96,13 +102,14 @@
|
|
|
96
102
|
"@types/resolve": "latest",
|
|
97
103
|
"@types/semver": "latest",
|
|
98
104
|
"@types/yargs": "latest",
|
|
105
|
+
"@types/yargs-parser": "^15.0.0",
|
|
99
106
|
"conventional-changelog-cli": "2.x",
|
|
100
107
|
"cross-spawn": "latest",
|
|
101
108
|
"eslint": "latest",
|
|
102
109
|
"fs-extra": "latest",
|
|
103
110
|
"glob-gitignore": "latest",
|
|
104
|
-
"husky": "
|
|
105
|
-
"jest": "
|
|
111
|
+
"husky": "3.x",
|
|
112
|
+
"jest": "25.x",
|
|
106
113
|
"js-yaml": "latest",
|
|
107
114
|
"lint-staged": "latest",
|
|
108
115
|
"lodash.merge": "4.x",
|