ts-jest 24.0.2 → 24.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 CHANGED
@@ -1 +1 @@
1
- 0aceab77a1f613fedb22a0395a65327e834ef35c
1
+ 7145adc485d1d0fa5bc7b6467bd416798f0a9a49
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ <a name="24.1.0"></a>
2
+ # [24.1.0](https://github.com/kulshekhar/ts-jest/compare/v24.0.2...v24.1.0) (2019-09-12)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * [#825](https://github.com/kulshekhar/ts-jest/issues/825) handle symlinked modules (ala pnpm) correctly ([e190b23](https://github.com/kulshekhar/ts-jest/commit/e190b23))
8
+ * handle tsBuildInfoFile option ([f9583e9](https://github.com/kulshekhar/ts-jest/commit/f9583e9)), closes [#1095](https://github.com/kulshekhar/ts-jest/issues/1095)
9
+ * **perf:** add cache for fs calls ([#908](https://github.com/kulshekhar/ts-jest/issues/908)) ([3dada81](https://github.com/kulshekhar/ts-jest/commit/3dada81))
10
+ * **types:** unforce esModuleInterop in tsconfig.json ([c2d39b6](https://github.com/kulshekhar/ts-jest/commit/c2d39b6))
11
+
12
+
13
+
1
14
  <a name="24.0.2"></a>
2
15
  ## [24.0.2](https://github.com/kulshekhar/ts-jest/compare/v24.0.1...v24.0.2) (2019-04-05)
3
16
 
package/README.md CHANGED
@@ -46,7 +46,7 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduc
46
46
 
47
47
  ## Versioning
48
48
 
49
- We **DO NOT** use [SemVer](http://semver.org/) for versioning. Tho you can think about SemVer when reading our version, except our major number follows the one of Jest. For the versions available, see the [tags on this repository](https://github.com/kulshekhar/ts-jest/tags).
49
+ We **DO NOT** use [SemVer](http://semver.org/) for versioning. Though you can think about SemVer when reading our version, except our major number follows the one of Jest. For the versions available, see the [tags on this repository](https://github.com/kulshekhar/ts-jest/tags).
50
50
 
51
51
  ## Authors/maintainers
52
52
 
@@ -11,10 +11,11 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
15
  return new (P || (P = Promise))(function (resolve, reject) {
15
16
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
17
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
19
  step((generator = generator.apply(thisArg, _arguments || [])).next());
19
20
  });
20
21
  };
@@ -45,13 +46,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
46
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
47
  }
47
48
  };
48
- var _this = this;
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
50
  var fs_1 = require("fs");
51
51
  var json5_1 = require("json5");
52
52
  var path_1 = require("path");
53
53
  var presets_1 = require("../helpers/presets");
54
- exports.run = function (args) { return __awaiter(_this, void 0, void 0, function () {
54
+ exports.run = function (args) { return __awaiter(void 0, void 0, void 0, function () {
55
55
  var file, filePath, name, isPackage, exists, pkgFile, hasPackage, _a, jestPreset, askedTsconfig, force, jsdom, tsconfig, pkgJson, jsFilesProcessor, shouldPostProcessWithBabel, preset, body, base, tsJestConf, content;
56
56
  return __generator(this, function (_b) {
57
57
  file = args._[0] || 'jest.config.js';
@@ -110,7 +110,7 @@ exports.run = function (args) { return __awaiter(_this, void 0, void 0, function
110
110
  if (shouldPostProcessWithBabel)
111
111
  tsJestConf.babelConfig = true;
112
112
  }
113
- body = JSON.stringify(__assign({}, pkgJson, { jest: base }), undefined, ' ');
113
+ body = JSON.stringify(__assign(__assign({}, pkgJson), { jest: base }), undefined, ' ');
114
114
  }
115
115
  else {
116
116
  content = [];
@@ -144,7 +144,7 @@ exports.run = function (args) { return __awaiter(_this, void 0, void 0, function
144
144
  return [2];
145
145
  });
146
146
  }); };
147
- exports.help = function () { return __awaiter(_this, void 0, void 0, function () {
147
+ exports.help = function () { return __awaiter(void 0, void 0, void 0, function () {
148
148
  return __generator(this, function (_a) {
149
149
  process.stdout.write("\nUsage:\n ts-jest config:init [options] [<config-file>]\n\nArguments:\n <config-file> Can be a js or json Jest config file. If it is a\n package.json file, the configuration will be read from\n the \"jest\" property.\n Default: jest.config.js\n\nOptions:\n --force Discard any existing Jest config\n --js ts|babel Process .js files with ts-jest if 'ts' or with\n babel-jest if 'babel'\n --no-jest-preset Disable the use of Jest presets\n --tsconfig <file> Path to the tsconfig.json file\n --babel Pipe babel-jest after ts-jest\n --jsdom Use jsdom as test environment instead of node\n");
150
150
  return [2];
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
4
5
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
6
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
9
  });
9
10
  };
@@ -54,19 +55,15 @@ var __spread = (this && this.__spread) || function () {
54
55
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
55
56
  return ar;
56
57
  };
57
- var __importDefault = (this && this.__importDefault) || function (mod) {
58
- return (mod && mod.__esModule) ? mod : { "default": mod };
59
- };
60
- var _this = this;
61
58
  Object.defineProperty(exports, "__esModule", { value: true });
62
59
  var bs_logger_1 = require("bs-logger");
63
- var fast_json_stable_stringify_1 = __importDefault(require("fast-json-stable-stringify"));
60
+ var stringifyJson = require("fast-json-stable-stringify");
64
61
  var fs_1 = require("fs");
65
62
  var json5_1 = require("json5");
66
63
  var path_1 = require("path");
67
64
  var backports_1 = require("../../util/backports");
68
65
  var presets_1 = require("../helpers/presets");
69
- exports.run = function (args) { return __awaiter(_this, void 0, void 0, function () {
66
+ exports.run = function (args) { return __awaiter(void 0, void 0, void 0, function () {
70
67
  var nullLogger, file, filePath, footNotes, name, isPackage, actualConfig, migratedConfig, presetName, preset, jsTransformers, jsWithTs, jsWithBabel, presetValue, migratedValue, presetValue, migratedValue, before, after, stringify, prefix;
71
68
  return __generator(this, function (_a) {
72
69
  nullLogger = bs_logger_1.createLogger({ targets: [] });
@@ -158,13 +155,13 @@ exports.run = function (args) { return __awaiter(_this, void 0, void 0, function
158
155
  }
159
156
  if (preset &&
160
157
  migratedConfig.transform &&
161
- fast_json_stable_stringify_1.default(migratedConfig.transform) === fast_json_stable_stringify_1.default(preset.value.transform)) {
158
+ stringifyJson(migratedConfig.transform) === stringifyJson(preset.value.transform)) {
162
159
  delete migratedConfig.transform;
163
160
  }
164
161
  cleanupConfig(actualConfig);
165
162
  cleanupConfig(migratedConfig);
166
- before = fast_json_stable_stringify_1.default(actualConfig);
167
- after = fast_json_stable_stringify_1.default(migratedConfig);
163
+ before = stringifyJson(actualConfig);
164
+ after = stringifyJson(migratedConfig);
168
165
  if (after === before) {
169
166
  process.stderr.write("\nNo migration needed for given Jest configuration\n ");
170
167
  return [2];
@@ -212,7 +209,7 @@ function dedupSort(arr) {
212
209
  .filter(function (s, i, a) { return a.findIndex(function (e) { return s.toString() === e.toString(); }) === i; })
213
210
  .sort(function (a, b) { return (a.toString() > b.toString() ? 1 : a.toString() < b.toString() ? -1 : 0); });
214
211
  }
215
- exports.help = function () { return __awaiter(_this, void 0, void 0, function () {
212
+ exports.help = function () { return __awaiter(void 0, void 0, void 0, function () {
216
213
  return __generator(this, function (_a) {
217
214
  process.stdout.write("\nUsage:\n ts-jest config:migrate [options] <config-file>\n\nArguments:\n <config-file> Can be a js or json Jest config file. If it is a\n package.json file, the configuration will be read from\n the \"jest\" property.\n\nOptions:\n --js ts|babel Process .js files with ts-jest if 'ts' or with\n babel-jest if 'babel'\n --no-jest-preset Disable the use of Jest presets\n");
218
215
  return [2];
package/dist/cli/help.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
4
5
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
6
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
9
  });
9
10
  };
@@ -34,9 +35,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
36
  }
36
37
  };
37
- var _this = this;
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.run = function (_) { return __awaiter(_this, void 0, void 0, function () {
39
+ exports.run = function (_) { return __awaiter(void 0, void 0, void 0, function () {
40
40
  return __generator(this, function (_a) {
41
41
  process.stdout.write("\nUsage:\n ts-jest command [options] [...args]\n\nCommands:\n config:init Creates initial Jest configuration\n config:migrate Migrates a given Jest configuration\n help [command] Show this help, or help about a command\n\nExample:\n ts-jest help config:migrate\n");
42
42
  return [2];
package/dist/cli/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
4
5
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
6
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
9
  });
9
10
  };
@@ -34,13 +35,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
36
  }
36
37
  };
37
- var __importDefault = (this && this.__importDefault) || function (mod) {
38
- return (mod && mod.__esModule) ? mod : { "default": mod };
39
- };
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
38
  var _a;
39
+ Object.defineProperty(exports, "__esModule", { value: true });
42
40
  var bs_logger_1 = require("bs-logger");
43
- var yargs_parser_1 = __importDefault(require("yargs-parser"));
41
+ var yargsParser = require("yargs-parser");
44
42
  var logger_1 = require("../util/logger");
45
43
  var VALID_COMMANDS = ['help', 'config:migrate', 'config:init'];
46
44
  var logger = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'cli', _a[bs_logger_1.LogContexts.application] = 'ts-jest', _a));
@@ -48,7 +46,7 @@ function cli(args) {
48
46
  return __awaiter(this, void 0, void 0, function () {
49
47
  var parsedArgv, command, isHelp, _a, run, help, cmd;
50
48
  return __generator(this, function (_b) {
51
- parsedArgv = yargs_parser_1.default(args, {
49
+ parsedArgv = yargsParser(args, {
52
50
  boolean: ['dry-run', 'jest-preset', 'allow-js', 'diff', 'babel', 'force', 'jsdom'],
53
51
  string: ['tsconfig', 'js'],
54
52
  count: ['verbose'],
package/dist/compiler.js CHANGED
@@ -10,15 +10,16 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __values = (this && this.__values) || function (o) {
14
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
13
+ var __values = (this && this.__values) || function(o) {
14
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
15
15
  if (m) return m.call(o);
16
- return {
16
+ if (o && typeof o.length === "number") return {
17
17
  next: function () {
18
18
  if (o && i >= o.length) o = void 0;
19
19
  return { value: o && o[i++], done: !o };
20
20
  }
21
21
  };
22
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
22
23
  };
23
24
  var __read = (this && this.__read) || function (o, n) {
24
25
  var m = typeof Symbol === "function" && o[Symbol.iterator];
@@ -36,14 +37,12 @@ var __read = (this && this.__read) || function (o, n) {
36
37
  }
37
38
  return ar;
38
39
  };
39
- var __importDefault = (this && this.__importDefault) || function (mod) {
40
- return (mod && mod.__esModule) ? mod : { "default": mod };
41
- };
42
40
  Object.defineProperty(exports, "__esModule", { value: true });
43
41
  var bs_logger_1 = require("bs-logger");
44
- var buffer_from_1 = __importDefault(require("buffer-from"));
42
+ var bufferFrom = require("buffer-from");
45
43
  var stableStringify = require("fast-json-stable-stringify");
46
44
  var fs_1 = require("fs");
45
+ var memoize = require("lodash.memoize");
47
46
  var mkdirp = require("mkdirp");
48
47
  var path_1 = require("path");
49
48
  var messages_1 = require("./util/messages");
@@ -112,7 +111,7 @@ function createCompiler(configs) {
112
111
  _b.namespace = 'ts:serviceHost',
113
112
  _b.call = null,
114
113
  _b);
115
- var serviceHostTraceCtx = __assign({}, serviceHostDebugCtx, (_c = {}, _c[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace, _c));
114
+ var serviceHostTraceCtx = __assign(__assign({}, serviceHostDebugCtx), (_c = {}, _c[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace, _c));
116
115
  var serviceHost = {
117
116
  getScriptFileNames: function () { return Object.keys(memoryCache.versions); },
118
117
  getScriptVersion: function (fileName) {
@@ -131,11 +130,12 @@ function createCompiler(configs) {
131
130
  }
132
131
  return ts.ScriptSnapshot.fromString(contents);
133
132
  },
134
- fileExists: ts.sys.fileExists,
135
- readFile: logger.wrap(serviceHostTraceCtx, 'readFile', ts.sys.readFile),
136
- readDirectory: ts.sys.readDirectory,
137
- getDirectories: ts.sys.getDirectories,
138
- directoryExists: ts.sys.directoryExists,
133
+ fileExists: memoize(ts.sys.fileExists),
134
+ readFile: logger.wrap(serviceHostTraceCtx, 'readFile', memoize(ts.sys.readFile)),
135
+ readDirectory: memoize(ts.sys.readDirectory),
136
+ getDirectories: memoize(ts.sys.getDirectories),
137
+ directoryExists: memoize(ts.sys.directoryExists),
138
+ realpath: memoize(ts.sys.realpath),
139
139
  getNewLine: function () { return '\n'; },
140
140
  getCurrentDirectory: function () { return cwd; },
141
141
  getCompilationSettings: function () { return compilerOptions; },
@@ -213,7 +213,7 @@ function readThrough(cachedir, memoryCache, compile, getExtension, cwd, logger)
213
213
  }
214
214
  function updateOutput(outputText, fileName, sourceMap, getExtension, sourceRoot) {
215
215
  var base = path_1.basename(fileName);
216
- var base64Map = buffer_from_1.default(updateSourceMap(sourceMap, fileName, sourceRoot), 'utf8').toString('base64');
216
+ var base64Map = bufferFrom(updateSourceMap(sourceMap, fileName, sourceRoot), 'utf8').toString('base64');
217
217
  var sourceMapContent = "data:application/json;charset=utf-8;base64," + base64Map;
218
218
  var sourceMapLength = (base + ".map").length + (getExtension(fileName).length - path_1.extname(fileName).length);
219
219
  return outputText.slice(0, -sourceMapLength) + sourceMapContent;
@@ -16,15 +16,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
16
16
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
17
17
  return c > 3 && r && Object.defineProperty(target, key, r), r;
18
18
  };
19
- var __values = (this && this.__values) || function (o) {
20
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
19
+ var __values = (this && this.__values) || function(o) {
20
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
21
21
  if (m) return m.call(o);
22
- return {
22
+ if (o && typeof o.length === "number") return {
23
23
  next: function () {
24
24
  if (o && i >= o.length) o = void 0;
25
25
  return { value: o && o[i++], done: !o };
26
26
  }
27
27
  };
28
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
28
29
  };
29
30
  var __read = (this && this.__read) || function (o, n) {
30
31
  var m = typeof Symbol === "function" && o[Symbol.iterator];
@@ -46,15 +47,12 @@ var __spread = (this && this.__spread) || function () {
46
47
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
47
48
  return ar;
48
49
  };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
50
  Object.defineProperty(exports, "__esModule", { value: true });
53
51
  var bs_logger_1 = require("bs-logger");
54
52
  var fs_1 = require("fs");
55
- var json5_1 = __importDefault(require("json5"));
53
+ var json5 = require("json5");
56
54
  var path_1 = require("path");
57
- var semver_1 = __importDefault(require("semver"));
55
+ var semver = require("semver");
58
56
  var __1 = require("..");
59
57
  var compiler_1 = require("../compiler");
60
58
  var transformers_1 = require("../transformers");
@@ -88,8 +86,8 @@ var toDiagnosticCode = function (code) {
88
86
  return code ? parseInt(("" + code).trim().replace(/^TS/, ''), 10) || undefined : undefined;
89
87
  };
90
88
  var toDiagnosticCodeList = function (items, into) {
91
- if (into === void 0) { into = []; }
92
89
  var e_1, _a;
90
+ if (into === void 0) { into = []; }
93
91
  if (!Array.isArray(items))
94
92
  items = [items];
95
93
  try {
@@ -166,7 +164,7 @@ var ConfigSet = (function () {
166
164
  Object.defineProperty(ConfigSet.prototype, "projectDependencies", {
167
165
  get: function () {
168
166
  var pkg = this.projectPackageJson;
169
- var names = Object.keys(__assign({}, pkg.optionalDependencies, pkg.peerDependencies, pkg.devDependencies, pkg.dependencies));
167
+ var names = Object.keys(__assign(__assign(__assign(__assign({}, pkg.optionalDependencies), pkg.peerDependencies), pkg.devDependencies), pkg.dependencies));
170
168
  return names.reduce(function (map, name) {
171
169
  var version = get_package_version_1.getPackageVersion(name);
172
170
  if (version)
@@ -182,7 +180,7 @@ var ConfigSet = (function () {
182
180
  var config = backports_1.backportJestConfig(this.logger, this._jestConfig);
183
181
  if (this.parentOptions) {
184
182
  var globals = config.globals || (config.globals = {});
185
- globals['ts-jest'] = __assign({}, this.parentOptions, globals['ts-jest']);
183
+ globals['ts-jest'] = __assign(__assign({}, this.parentOptions), globals['ts-jest']);
186
184
  }
187
185
  this.logger.debug({ jestConfig: config }, 'normalized jest config');
188
186
  return config;
@@ -342,7 +340,7 @@ var ConfigSet = (function () {
342
340
  });
343
341
  ConfigSet.loadConfig = function (base) {
344
342
  var _a = importer_1.importer.babelCore(messages_1.ImportReasons.BabelJest), OptionManager = _a.OptionManager, loadPartialConfig = _a.loadPartialConfig, version = _a.version;
345
- if (version && semver_1.default.satisfies(version, '>=6 <7')) {
343
+ if (version && semver.satisfies(version, '>=6 <7')) {
346
344
  delete base.cwd;
347
345
  }
348
346
  if (typeof loadPartialConfig === 'function') {
@@ -363,11 +361,11 @@ var ConfigSet = (function () {
363
361
  var base = { cwd: this.cwd };
364
362
  if (babelConfig.kind === 'file') {
365
363
  if (babelConfig.value) {
366
- base = __assign({}, base, json5_1.default.parse(fs_1.readFileSync(babelConfig.value, 'utf8')));
364
+ base = __assign(__assign({}, base), json5.parse(fs_1.readFileSync(babelConfig.value, 'utf8')));
367
365
  }
368
366
  }
369
367
  else if (babelConfig.kind === 'inline') {
370
- base = __assign({}, base, babelConfig.value);
368
+ base = __assign(__assign({}, base), babelConfig.value);
371
369
  }
372
370
  var config = ConfigSet.loadConfig(base);
373
371
  this.logger.debug({ babelConfig: config }, 'normalized babel config');
@@ -534,7 +532,9 @@ var ConfigSet = (function () {
534
532
  declarationDir: undefined,
535
533
  declarationMap: undefined,
536
534
  emitDeclarationOnly: undefined,
535
+ incremental: undefined,
537
536
  sourceRoot: undefined,
537
+ tsBuildInfoFile: undefined,
538
538
  };
539
539
  if (!this.tsJest.babelConfig) {
540
540
  options.module = this.compilerModule.ModuleKind.CommonJS;
@@ -635,11 +635,11 @@ var ConfigSet = (function () {
635
635
  };
636
636
  }
637
637
  config = result_1.config;
638
- input = __assign({}, result_1.config, { compilerOptions: __assign({}, (result_1.config && result_1.config.compilerOptions), compilerOptions) });
638
+ input = __assign(__assign({}, result_1.config), { compilerOptions: __assign(__assign({}, (result_1.config && result_1.config.compilerOptions)), compilerOptions) });
639
639
  basePath = normalize_slashes_1.normalizeSlashes(path_1.dirname(configFileName));
640
640
  }
641
641
  }
642
- config.compilerOptions = __assign({}, config.compilerOptions, compilerOptions);
642
+ config.compilerOptions = __assign(__assign({}, config.compilerOptions), compilerOptions);
643
643
  var result = ts.parseJsonConfigFileContent(config, ts.sys, basePath, undefined, configFileName);
644
644
  var forcedOptions = this.overriddenCompilerOptions;
645
645
  var finalOptions = result.options;
@@ -14,10 +14,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  var logger_1 = require("../util/logger");
15
15
  var logger = logger_1.rootLogger.child({ namespace: 'jest-preset' });
16
16
  function createJestPreset(_a, from) {
17
- var _b = (_a === void 0 ? {} : _a).allowJs, allowJs = _b === void 0 ? false : _b;
17
+ var _b;
18
+ var _c = (_a === void 0 ? {} : _a).allowJs, allowJs = _c === void 0 ? false : _c;
18
19
  if (from === void 0) { from = {}; }
19
- var _c;
20
20
  logger.debug({ allowJs: allowJs }, 'creating jest presets', allowJs ? 'handling' : 'not handling', 'JavaScript files');
21
- return __assign({ transform: __assign({}, from.transform, (_c = {}, _c[allowJs ? '^.+\\.[tj]sx?$' : '^.+\\.tsx?$'] = 'ts-jest', _c)) }, (from.testMatch ? { testMatch: from.testMatch } : undefined), (from.moduleFileExtensions ? { moduleFileExtensions: from.moduleFileExtensions } : undefined));
21
+ return __assign(__assign({ transform: __assign(__assign({}, from.transform), (_b = {}, _b[allowJs ? '^.+\\.[tj]sx?$' : '^.+\\.tsx?$'] = 'ts-jest', _b)) }, (from.testMatch ? { testMatch: from.testMatch } : undefined)), (from.moduleFileExtensions ? { moduleFileExtensions: from.moduleFileExtensions } : undefined));
22
22
  }
23
23
  exports.createJestPreset = createJestPreset;
@@ -1,24 +1,25 @@
1
1
  "use strict";
2
- var __values = (this && this.__values) || function (o) {
3
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
2
+ var __values = (this && this.__values) || function(o) {
3
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
4
  if (m) return m.call(o);
5
- return {
5
+ if (o && typeof o.length === "number") return {
6
6
  next: function () {
7
7
  if (o && i >= o.length) o = void 0;
8
8
  return { value: o && o[i++], done: !o };
9
9
  }
10
10
  };
11
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
12
  };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
13
  var _a;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
14
15
  var bs_logger_1 = require("bs-logger");
15
16
  var logger_1 = require("../util/logger");
16
17
  var messages_1 = require("../util/messages");
17
18
  var escapeRegex = function (str) { return str.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&'); };
18
19
  var logger = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'path-mapper', _a));
19
20
  exports.pathsToModuleNameMapper = function (mapping, _a) {
20
- var _b = (_a === void 0 ? {} : _a).prefix, prefix = _b === void 0 ? '' : _b;
21
- var e_1, _c;
21
+ var e_1, _b;
22
+ var _c = (_a === void 0 ? {} : _a).prefix, prefix = _c === void 0 ? '' : _c;
22
23
  var jestMap = {};
23
24
  try {
24
25
  for (var _d = __values(Object.keys(mapping)), _e = _d.next(); !_e.done; _e = _d.next()) {
@@ -54,7 +55,7 @@ exports.pathsToModuleNameMapper = function (mapping, _a) {
54
55
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
55
56
  finally {
56
57
  try {
57
- if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
58
+ if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
58
59
  }
59
60
  finally { if (e_1) throw e_1.error; }
60
61
  }
package/dist/index.js CHANGED
@@ -19,8 +19,8 @@ var __spread = (this && this.__spread) || function () {
19
19
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
20
20
  return ar;
21
21
  };
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
22
  var _a;
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
24
  var bs_logger_1 = require("bs-logger");
25
25
  var fs_1 = require("fs");
26
26
  var path_1 = require("path");
@@ -50,20 +50,20 @@ function createTransformer(baseConfig) {
50
50
  }
51
51
  exports.createTransformer = createTransformer;
52
52
  function process() {
53
+ var _a;
53
54
  var args = [];
54
55
  for (var _i = 0; _i < arguments.length; _i++) {
55
56
  args[_i] = arguments[_i];
56
57
  }
57
- var _a;
58
58
  return (_a = defaultTransformer()).process.apply(_a, __spread(args));
59
59
  }
60
60
  exports.process = process;
61
61
  function getCacheKey() {
62
+ var _a;
62
63
  var args = [];
63
64
  for (var _i = 0; _i < arguments.length; _i++) {
64
65
  args[_i] = arguments[_i];
65
66
  }
66
- var _a;
67
67
  return (_a = defaultTransformer()).getCacheKey.apply(_a, __spread(args));
68
68
  }
69
69
  exports.getCacheKey = getCacheKey;
@@ -1,11 +1,4 @@
1
1
  "use strict";
2
- var __importStar = (this && this.__importStar) || function (mod) {
3
- if (mod && mod.__esModule) return mod;
4
- var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
7
- return result;
8
- };
9
2
  Object.defineProperty(exports, "__esModule", { value: true });
10
- var hoisting = __importStar(require("./hoist-jest"));
3
+ var hoisting = require("./hoist-jest");
11
4
  exports.internals = [hoisting];
@@ -107,7 +107,7 @@ var TsJestTransformer = (function () {
107
107
  }
108
108
  if (babelJest) {
109
109
  this.logger.debug({ fileName: filePath }, 'calling babel-jest processor');
110
- result = babelJest.process(result, filePath, jestConfig, __assign({}, transformOptions, { instrument: false }));
110
+ result = babelJest.process(result, filePath, jestConfig, __assign(__assign({}, transformOptions), { instrument: false }));
111
111
  }
112
112
  if (hooks.afterProcess) {
113
113
  this.logger.debug({ fileName: filePath, hookName: 'afterProcess' }, 'calling afterProcess hook');
package/dist/types.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="jest" />
2
2
  import * as _babel from 'babel__core';
3
- import _ts, { CompilerOptions, SourceFile, TransformerFactory } from 'typescript';
3
+ import { CompilerOptions, SourceFile, TransformerFactory } from 'typescript';
4
+ import * as _ts from 'typescript';
4
5
  import { ConfigSet } from './config/config-set';
5
6
  export declare type TBabelCore = typeof _babel;
6
7
  export declare type TTypeScript = typeof _ts;
@@ -10,13 +10,13 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
13
  var _a;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  var bs_logger_1 = require("bs-logger");
16
16
  var messages_1 = require("./messages");
17
17
  var context = (_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'backports', _a);
18
18
  exports.backportJestConfig = function (logger, config) {
19
- logger.debug(__assign({}, context, { config: config }), 'backporting config');
19
+ logger.debug(__assign(__assign({}, context), { config: config }), 'backporting config');
20
20
  var _a = (config || {}).globals, globals = _a === void 0 ? {} : _a;
21
21
  var _b = globals["ts-jest"], tsJest = _b === void 0 ? {} : _b;
22
22
  var mergeTsJest = {};
@@ -84,7 +84,7 @@ exports.backportJestConfig = function (logger, config) {
84
84
  if (hadWarnings) {
85
85
  logger.warn(context, messages_1.Helps.MigrateConfigUsingCLI);
86
86
  }
87
- return __assign({}, config, { globals: __assign({}, globals, { 'ts-jest': __assign({}, mergeTsJest, tsJest) }) });
87
+ return __assign(__assign({}, config), { globals: __assign(__assign({}, globals), { 'ts-jest': __assign(__assign({}, mergeTsJest), tsJest) }) });
88
88
  };
89
89
  exports.backportTsJestDebugEnvVar = function (logger) {
90
90
  if ('TS_JEST_DEBUG' in process.env) {
@@ -5,7 +5,7 @@ var __extends = (this && this.__extends) || (function () {
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
6
  function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
- }
8
+ };
9
9
  return function (d, b) {
10
10
  extendStatics(d, b);
11
11
  function __() { this.constructor = d; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-jest",
3
- "version": "24.0.2",
3
+ "version": "24.1.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "bin": "cli.js",
@@ -59,6 +59,7 @@
59
59
  "bs-logger": "0.x",
60
60
  "buffer-from": "1.x",
61
61
  "fast-json-stable-stringify": "2.x",
62
+ "lodash.memoize": "4.x",
62
63
  "json5": "2.x",
63
64
  "make-error": "1.x",
64
65
  "mkdirp": "0.x",
@@ -77,7 +78,7 @@
77
78
  }
78
79
  },
79
80
  "devDependencies": {
80
- "@commitlint/cli": "7.x",
81
+ "@commitlint/cli": "8.x",
81
82
  "@commitlint/config-conventional": "7.x",
82
83
  "@types/babel__core": "7.x",
83
84
  "@types/buffer-from": "latest",
@@ -103,7 +104,6 @@
103
104
  "jest": "24.x",
104
105
  "js-yaml": "latest",
105
106
  "lint-staged": "latest",
106
- "lodash.memoize": "4.x",
107
107
  "lodash.merge": "4.x",
108
108
  "lodash.set": "4.x",
109
109
  "npm-run-all": "latest",
@@ -115,16 +115,14 @@
115
115
  "typescript": "3.x"
116
116
  },
117
117
  "lint-staged": {
118
- "linters": {
119
- "*.{ts,tsx}": [
120
- "tslint --fix",
121
- "git add"
122
- ],
123
- "*.{js,jsx}": [
124
- "eslint --fix",
125
- "git add"
126
- ]
127
- }
118
+ "*.{ts,tsx}": [
119
+ "tslint --fix",
120
+ "git add"
121
+ ],
122
+ "*.{js,jsx}": [
123
+ "eslint --fix",
124
+ "git add"
125
+ ]
128
126
  },
129
127
  "engines": {
130
128
  "node": ">= 6"
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- package-lock.json -diff -merge
2
- package-lock.json linguist-generated=true
package/icon.png DELETED
Binary file