ts-jest 27.0.0 → 27.0.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 CHANGED
@@ -1 +1 @@
1
- a1376fb91cb7def505cacd7981109827042bd189
1
+ ca007d0ed5f95b54e87f204bbcb1a8a005bab7fc
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [27.0.1](https://github.com/kulshekhar/ts-jest/compare/v27.0.0...v27.0.1) (2021-05-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **cli:** keep `testMatch` if old jest config contains it ([#2618](https://github.com/kulshekhar/ts-jest/issues/2618)) ([c568f49](https://github.com/kulshekhar/ts-jest/commit/c568f49907fb5559ba1e8c67f1ec5d5eb4af920a)), closes [#2616](https://github.com/kulshekhar/ts-jest/issues/2616)
7
+ * **compiler:** make sure `isolatedModules: false` use updated compiler options ([#2628](https://github.com/kulshekhar/ts-jest/issues/2628)) ([348e30f](https://github.com/kulshekhar/ts-jest/commit/348e30f426803efc51ecba26ab42619938fcb5af)), closes [#2629](https://github.com/kulshekhar/ts-jest/issues/2629)
8
+ * add missing export `presets` ([#2624](https://github.com/kulshekhar/ts-jest/issues/2624)) ([0ea025e](https://github.com/kulshekhar/ts-jest/commit/0ea025ebb456d3a31671e31fac0b401c2734a2b1)), closes [#2623](https://github.com/kulshekhar/ts-jest/issues/2623)
9
+
10
+
11
+
12
+ ## [27.0.1](https://github.com/kulshekhar/ts-jest/compare/v27.0.0...v27.0.1) (2021-05-26)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **cli:** keep `testMatch` if old jest config contains it ([#2618](https://github.com/kulshekhar/ts-jest/issues/2618)) ([c568f49](https://github.com/kulshekhar/ts-jest/commit/c568f49907fb5559ba1e8c67f1ec5d5eb4af920a)), closes [#2616](https://github.com/kulshekhar/ts-jest/issues/2616)
18
+ * add missing export `presets` ([#2624](https://github.com/kulshekhar/ts-jest/issues/2624)) ([0ea025e](https://github.com/kulshekhar/ts-jest/commit/0ea025ebb456d3a31671e31fac0b401c2734a2b1)), closes [#2623](https://github.com/kulshekhar/ts-jest/issues/2623)
19
+
20
+
21
+
1
22
  # [27.0.0](https://github.com/kulshekhar/ts-jest/compare/v26.5.6...v27.0.0) (2021-05-25)
2
23
 
3
24
 
@@ -115,7 +136,7 @@ module.exports = {
115
136
  ```
116
137
  * Remove possibilities to import `mocked`, `createJestPreset`, `pathsToModuleNameMapper` from package entry. One should change to
117
138
  ```
118
- import { mocked, createJestPreset, pathsToModuleNameMapper` } from 'ts-jest/utils'
139
+ import { mocked, createJestPreset, pathsToModuleNameMapper } from 'ts-jest/utils'
119
140
  ```
120
141
  * **config:** One currently uses `tsConfig` should change to `tsconfig` in your `jest.config.js` or `package.json`.
121
142
 
@@ -70,8 +70,8 @@ var backports_1 = require("../../utils/backports");
70
70
  var presets_1 = require("../helpers/presets");
71
71
  var run = function (args) { return __awaiter(void 0, void 0, void 0, function () {
72
72
  var nullLogger, file, filePath, footNotes, name, isPackage, actualConfig, migratedConfig, presetName, preset, jsTransformers, jsWithTs, jsWithBabel, presetValue, migratedValue, presetValue, migratedValue, before, after, stringify, prefix;
73
- var _a;
74
- return __generator(this, function (_b) {
73
+ var _a, _b, _c, _d, _e, _f, _g, _h;
74
+ return __generator(this, function (_j) {
75
75
  nullLogger = bs_logger_1.createLogger({ targets: [] });
76
76
  file = (_a = args._[0]) === null || _a === void 0 ? void 0 : _a.toString();
77
77
  filePath = path_1.resolve(process.cwd(), file);
@@ -119,32 +119,32 @@ var run = function (args) { return __awaiter(void 0, void 0, void 0, function ()
119
119
  presetName = "ts-jest/presets/default";
120
120
  }
121
121
  }
122
- presetName = presetName || "ts-jest/presets/default";
122
+ presetName = presetName !== null && presetName !== void 0 ? presetName : "ts-jest/presets/default";
123
123
  preset = presets_1.allPresets[presetName];
124
124
  footNotes.push("Detected preset '" + preset.label + "' as the best matching preset for your configuration.\nVisit https://kulshekhar.github.io/ts-jest/user/config/#jest-preset for more information about presets.\n");
125
125
  }
126
- else if (migratedConfig.preset && migratedConfig.preset.startsWith('ts-jest')) {
126
+ else if ((_b = migratedConfig.preset) === null || _b === void 0 ? void 0 : _b.startsWith('ts-jest')) {
127
127
  if (args.jestPreset === false) {
128
128
  delete migratedConfig.preset;
129
129
  }
130
130
  else {
131
- preset = presets_1.allPresets[migratedConfig.preset] || presets_1.defaults;
131
+ preset = (_c = presets_1.allPresets[migratedConfig.preset]) !== null && _c !== void 0 ? _c : presets_1.defaults;
132
132
  }
133
133
  }
134
134
  if (preset)
135
135
  migratedConfig.preset = preset.name;
136
- if (migratedConfig.moduleFileExtensions && migratedConfig.moduleFileExtensions.length && preset) {
137
- presetValue = dedupSort(preset.value.moduleFileExtensions || []).join('::');
136
+ if (((_d = migratedConfig.moduleFileExtensions) === null || _d === void 0 ? void 0 : _d.length) && preset) {
137
+ presetValue = dedupSort((_e = preset.value.moduleFileExtensions) !== null && _e !== void 0 ? _e : []).join('::');
138
138
  migratedValue = dedupSort(migratedConfig.moduleFileExtensions).join('::');
139
139
  if (presetValue === migratedValue) {
140
140
  delete migratedConfig.moduleFileExtensions;
141
141
  }
142
142
  }
143
- if (migratedConfig.testRegex && preset) {
144
- migratedConfig.testMatch = null;
143
+ if ((typeof migratedConfig.testRegex === 'string' || ((_f = migratedConfig.testRegex) === null || _f === void 0 ? void 0 : _f.length)) && preset) {
144
+ delete migratedConfig.testMatch;
145
145
  }
146
- else if (migratedConfig.testMatch && migratedConfig.testMatch.length && preset) {
147
- presetValue = dedupSort(preset.value.testMatch || []).join('::');
146
+ else if (((_g = migratedConfig.testMatch) === null || _g === void 0 ? void 0 : _g.length) && preset) {
147
+ presetValue = dedupSort((_h = preset.value.testMatch) !== null && _h !== void 0 ? _h : []).join('::');
148
148
  migratedValue = dedupSort(migratedConfig.testMatch).join('::');
149
149
  if (presetValue === migratedValue) {
150
150
  delete migratedConfig.testMatch;
@@ -191,21 +191,21 @@ function cleanupConfig(config) {
191
191
  if (config.globals['ts-jest'] && Object.keys(config.globals['ts-jest']).length === 0) {
192
192
  delete config.globals['ts-jest'];
193
193
  }
194
- if (Object.keys(config.globals).length === 0) {
194
+ if (!Object.keys(config.globals).length) {
195
195
  delete config.globals;
196
196
  }
197
197
  }
198
- if (config.transform && Object.keys(config.transform).length === 0) {
198
+ if (config.transform && !Object.keys(config.transform).length) {
199
199
  delete config.transform;
200
200
  }
201
201
  if (config.moduleFileExtensions) {
202
202
  config.moduleFileExtensions = dedupSort(config.moduleFileExtensions);
203
- if (config.moduleFileExtensions.length === 0)
203
+ if (!config.moduleFileExtensions.length)
204
204
  delete config.moduleFileExtensions;
205
205
  }
206
206
  if (config.testMatch) {
207
207
  config.testMatch = dedupSort(config.testMatch);
208
- if (config.testMatch.length === 0)
208
+ if (!config.testMatch.length)
209
209
  delete config.testMatch;
210
210
  }
211
211
  if (config.preset === "ts-jest/presets/default")
@@ -51,6 +51,7 @@ var path_1 = require("path");
51
51
  var bs_logger_1 = require("bs-logger");
52
52
  var memoize_1 = __importDefault(require("lodash/memoize"));
53
53
  var constants_1 = require("../constants");
54
+ var json_1 = require("../utils/json");
54
55
  var logger_1 = require("../utils/logger");
55
56
  var messages_1 = require("../utils/messages");
56
57
  var compiler_utils_1 = require("./compiler-utils");
@@ -272,6 +273,9 @@ var TsCompiler = (function () {
272
273
  shouldIncrementProjectVersion = true;
273
274
  }
274
275
  }
276
+ if (json_1.stringify(this._compilerOptions) !== json_1.stringify(this._initialCompilerOptions)) {
277
+ shouldIncrementProjectVersion = true;
278
+ }
275
279
  if (shouldIncrementProjectVersion)
276
280
  this._projectVersion++;
277
281
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "ts-jest",
3
- "version": "27.0.0",
3
+ "version": "27.0.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
7
7
  ".": "./dist/index.js",
8
8
  "./dist/*": "./dist/*.js",
9
9
  "./jest-preset": "./jest-preset.js",
10
- "./preset": "./presets/index.js",
10
+ "./presets": "./presets/index.js",
11
11
  "./utils": "./utils/index.js",
12
12
  "./package.json": "./package.json"
13
13
  },