ts-jest 29.2.3 → 29.2.5

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
- e2e2a6f444f612d652c89b646da7c2eb2867f35d
1
+ 2b7ef2723f3aa8f87bfd0da3dcd77adce2ba6314
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ### [29.2.5](https://github.com/kulshekhar/ts-jest/compare/v29.2.4...v29.2.5) (2024-08-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * build: build package with `NodeNext` module ([9b3ade5](https://github.com/kulshekhar/ts-jest/commit/9b3ade5))
7
+ * fix: set value `ts/tsx` `extensionsToTreatAsEsm` in default esm preset ([d9ff362](https://github.com/kulshekhar/ts-jest/commit/d9ff362))
8
+ * fix(compiler): fallback to `NodeJS` module resolution for ts 4.8 ([b7d3409](https://github.com/kulshekhar/ts-jest/commit/b7d3409)), closes [#4499](https://github.com/kulshekhar/ts-jest/issues/4499)
9
+
10
+
11
+
12
+ ### [29.2.4](https://github.com/kulshekhar/ts-jest/compare/v29.2.3...v29.2.4) (2024-08-01)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * fix: revert support implementation for `Node16/NodeNext` ([70b9530](https://github.com/kulshekhar/ts-jest/commit/70b9530)), closes [#4468](https://github.com/kulshekhar/ts-jest/issues/4468) [#4473](https://github.com/kulshekhar/ts-jest/issues/4473)
18
+
19
+
20
+
1
21
  ### [29.2.3](https://github.com/kulshekhar/ts-jest/compare/v29.2.2...v29.2.3) (2024-07-18)
2
22
 
3
23
 
@@ -114,22 +114,17 @@ var TsCompiler = /** @class */ (function () {
114
114
  };
115
115
  TsCompiler.prototype.fixupCompilerOptionsForModuleKind = function (compilerOptions, isEsm) {
116
116
  var _a, _b;
117
+ var moduleResolution = (_a = this._ts.ModuleResolutionKind.Node10) !== null && _a !== void 0 ? _a : this._ts.ModuleResolutionKind.NodeJs;
117
118
  if (!isEsm) {
118
- var moduleKind_1 = (_a = compilerOptions.module) !== null && _a !== void 0 ? _a : this._ts.ModuleKind.CommonJS;
119
- var moduleKindValue = [
120
- this._ts.ModuleKind.CommonJS,
121
- this._ts.ModuleKind.Node16,
122
- this._ts.ModuleKind.NodeNext,
123
- ].includes(moduleKind_1)
124
- ? moduleKind_1
125
- : this._ts.ModuleKind.CommonJS;
126
- return __assign(__assign({}, compilerOptions), { module: moduleKindValue });
119
+ return __assign(__assign({}, compilerOptions), { module: this._ts.ModuleKind.CommonJS, moduleResolution: moduleResolution });
127
120
  }
128
121
  var moduleKind = (_b = compilerOptions.module) !== null && _b !== void 0 ? _b : this._ts.ModuleKind.ESNext;
129
- var esModuleInterop = [this._ts.ModuleKind.Node16, this._ts.ModuleKind.NodeNext].includes(moduleKind)
130
- ? true
131
- : compilerOptions.esModuleInterop;
132
- return __assign(__assign({}, compilerOptions), { module: moduleKind, esModuleInterop: esModuleInterop !== null && esModuleInterop !== void 0 ? esModuleInterop : false });
122
+ var esModuleInterop = compilerOptions.esModuleInterop;
123
+ if ([this._ts.ModuleKind.Node16, this._ts.ModuleKind.NodeNext].includes(moduleKind)) {
124
+ esModuleInterop = true;
125
+ moduleKind = this._ts.ModuleKind.ESNext;
126
+ }
127
+ return __assign(__assign({}, compilerOptions), { module: moduleKind, esModuleInterop: esModuleInterop, moduleResolution: moduleResolution });
133
128
  };
134
129
  TsCompiler.prototype.getCompiledOutput = function (fileContent, fileName, options) {
135
130
  var e_1, _a;
@@ -135,7 +135,7 @@ function createDefaultEsmPreset(tsJestTransformOptions) {
135
135
  if (tsJestTransformOptions === void 0) { tsJestTransformOptions = {}; }
136
136
  logger.debug('creating default ESM Jest preset');
137
137
  return {
138
- extensionsToTreatAsEsm: __spreadArray(__spreadArray([], __read(constants_1.JS_EXT_TO_TREAT_AS_ESM), false), __read(constants_1.TS_EXT_TO_TREAT_AS_ESM), false),
138
+ extensionsToTreatAsEsm: __spreadArray([], __read(constants_1.TS_EXT_TO_TREAT_AS_ESM), false),
139
139
  transform: (_a = {},
140
140
  _a[constants_1.ESM_TS_TRANSFORM_PATTERN] = [
141
141
  'ts-jest',
@@ -149,7 +149,7 @@ function createDefaultEsmLegacyPreset(tsJestTransformOptions) {
149
149
  if (tsJestTransformOptions === void 0) { tsJestTransformOptions = {}; }
150
150
  logger.debug('creating default ESM Jest preset');
151
151
  return {
152
- extensionsToTreatAsEsm: __spreadArray(__spreadArray([], __read(constants_1.JS_EXT_TO_TREAT_AS_ESM), false), __read(constants_1.TS_EXT_TO_TREAT_AS_ESM), false),
152
+ extensionsToTreatAsEsm: __spreadArray([], __read(constants_1.TS_EXT_TO_TREAT_AS_ESM), false),
153
153
  transform: (_a = {},
154
154
  _a[constants_1.ESM_TS_TRANSFORM_PATTERN] = [
155
155
  'ts-jest/legacy',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-jest",
3
- "version": "29.2.3",
3
+ "version": "29.2.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "bin": {
@@ -11,8 +11,9 @@
11
11
  "prebuild": "rimraf dist coverage *.tgz",
12
12
  "build": "tsc -p tsconfig.build.json",
13
13
  "postbuild": "node scripts/post-build.js",
14
- "pretest": "tsc -p tsconfig.spec.json --noEmit && node scripts/create-bundle.js",
15
- "test": "jest",
14
+ "test": "jest -c=jest-src.config.ts",
15
+ "test-e2e-cjs": "jest -c=jest-e2e.config.cjs --no-cache",
16
+ "test-e2e-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-e2e.config.mjs --no-cache",
16
17
  "test-examples": "node scripts/test-examples.js",
17
18
  "lint": "eslint --ext .js,.ts .",
18
19
  "lint-fix": "eslint --fix --ext .js,.ts .",
@@ -51,15 +52,15 @@
51
52
  },
52
53
  "homepage": "https://kulshekhar.github.io/ts-jest",
53
54
  "dependencies": {
54
- "bs-logger": "0.x",
55
+ "bs-logger": "^0.2.6",
55
56
  "ejs": "^3.1.10",
56
- "fast-json-stable-stringify": "2.x",
57
+ "fast-json-stable-stringify": "^2.1.0",
57
58
  "jest-util": "^29.0.0",
58
59
  "json5": "^2.2.3",
59
- "lodash.memoize": "4.x",
60
- "make-error": "1.x",
61
- "semver": "^7.5.3",
62
- "yargs-parser": "^21.0.1"
60
+ "lodash.memoize": "^4.1.2",
61
+ "make-error": "^1.3.6",
62
+ "semver": "^7.6.3",
63
+ "yargs-parser": "^21.1.1"
63
64
  },
64
65
  "peerDependencies": {
65
66
  "@babel/core": ">=7.0.0-beta.0 <8",
@@ -94,49 +95,47 @@
94
95
  }
95
96
  },
96
97
  "devDependencies": {
97
- "@commitlint/cli": "18.6.1",
98
- "@commitlint/config-angular": "18.6.1",
98
+ "@commitlint/cli": "~18.6.1",
99
+ "@commitlint/config-angular": "~18.6.1",
100
+ "@jest/globals": "^29.7.0",
99
101
  "@jest/transform": "^29.7.0",
100
102
  "@jest/types": "^29.6.3",
101
- "@types/babel__core": "7.20.5",
102
- "@types/cross-spawn": "latest",
103
+ "@types/babel__core": "^7.20.5",
103
104
  "@types/ejs": "^3.1.5",
104
- "@types/fs-extra": "latest",
105
- "@types/js-yaml": "latest",
106
- "@types/lodash.camelcase": "4.3.9",
107
- "@types/lodash.memoize": "4.1.9",
108
- "@types/lodash.set": "4.3.9",
109
- "@types/micromatch": "4.0.9",
110
- "@types/node": "20.14.11",
111
- "@types/react": "18.x",
112
- "@types/semver": "latest",
113
- "@types/yargs": "latest",
105
+ "@types/fs-extra": "^11.0.4",
106
+ "@types/jest": "^29.5.12",
107
+ "@types/js-yaml": "^4.0.9",
108
+ "@types/lodash.camelcase": "^4.3.9",
109
+ "@types/lodash.memoize": "^4.1.9",
110
+ "@types/lodash.set": "^4.3.9",
111
+ "@types/micromatch": "^4.0.9",
112
+ "@types/node": "20.16.1",
113
+ "@types/semver": "^7.5.8",
114
+ "@types/yargs": "^17.0.33",
114
115
  "@types/yargs-parser": "21.0.3",
115
- "@typescript-eslint/eslint-plugin": "^7.16.1",
116
- "@typescript-eslint/parser": "^7.16.1",
116
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
117
+ "@typescript-eslint/parser": "^7.18.0",
117
118
  "babel-jest": "^29.7.0",
118
119
  "conventional-changelog-cli": "^5.0.0",
119
- "cross-spawn": "latest",
120
120
  "esbuild": "~0.21.5",
121
121
  "eslint": "^8.57.0",
122
122
  "eslint-config-prettier": "^9.1.0",
123
123
  "eslint-plugin-import": "^2.29.1",
124
- "eslint-plugin-jest": "^28.6.0",
125
- "eslint-plugin-jsdoc": "^48.7.0",
124
+ "eslint-plugin-jest": "^28.8.0",
125
+ "eslint-plugin-jsdoc": "^48.11.0",
126
126
  "eslint-plugin-prefer-arrow": "^1.2.3",
127
127
  "eslint-plugin-prettier": "^4.2.1",
128
128
  "execa": "5.1.1",
129
- "fs-extra": "11.2.0",
129
+ "fs-extra": "^11.2.0",
130
130
  "glob": "^10.2.6",
131
- "glob-gitignore": "latest",
132
- "husky": "4.x",
131
+ "glob-gitignore": "^1.0.14",
132
+ "husky": "~4.3.8",
133
133
  "jest": "^29.7.0",
134
- "jest-snapshot-serializer-raw": "^1.2.0",
135
- "js-yaml": "latest",
134
+ "js-yaml": "^4.1.0",
136
135
  "json-schema-to-typescript": "^13.1.2",
137
- "lint-staged": "latest",
136
+ "lint-staged": "^15.2.9",
138
137
  "prettier": "^2.8.8",
139
- "typescript": "~5.5.3"
138
+ "typescript": "~5.5.4"
140
139
  },
141
140
  "lint-staged": {
142
141
  "*.{ts,tsx,js,jsx}": [
package/globals.d.ts DELETED
@@ -1,18 +0,0 @@
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 {}