ts-jest 29.1.3 → 29.1.4
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 +14 -0
- package/dist/cli/config/init.js +3 -2
- package/dist/constants.js +2 -2
- package/package.json +19 -19
package/.ts-jest-digest
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
bdc3f261ac17efdeccd11ccec4d3ce6c393abe5d
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [29.1.4](https://github.com/kulshekhar/ts-jest/compare/v29.1.3...v29.1.4) (2024-05-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* fix(transformer): allow transforming of .cts/.mts extensions. (#3996) ([b8f6eaa](https://github.com/kulshekhar/ts-jest/commit/b8f6eaa)), closes [#3996](https://github.com/kulshekhar/ts-jest/issues/3996)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* feat: make cli generate esm config based on `type: "module"` (#4210) ([81a5f64](https://github.com/kulshekhar/ts-jest/commit/81a5f64)), closes [#4210](https://github.com/kulshekhar/ts-jest/issues/4210) [#4012](https://github.com/kulshekhar/ts-jest/issues/4012)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
1
15
|
## [29.1.3](https://github.com/kulshekhar/ts-jest/compare/v29.1.2...v29.1.3) (2024-05-21)
|
|
2
16
|
|
|
3
17
|
|
package/dist/cli/config/init.js
CHANGED
|
@@ -77,7 +77,7 @@ var presets_1 = require("../helpers/presets");
|
|
|
77
77
|
* @internal
|
|
78
78
|
*/
|
|
79
79
|
var run = function (args /* , logger: Logger */) { return __awaiter(void 0, void 0, void 0, function () {
|
|
80
|
-
var file, filePath, name, isPackage, exists, pkgFile, hasPackage, _a, jestPreset, askedTsconfig, force, jsdom, tsconfig, pkgJson, jsFilesProcessor, shouldPostProcessWithBabel, preset, body, jestConfig, transformerConfig, content;
|
|
80
|
+
var file, filePath, name, isPackage, exists, pkgFile, hasPackage, _a, jestPreset, askedTsconfig, force, jsdom, tsconfig, pkgJson, jsFilesProcessor, shouldPostProcessWithBabel, preset, body, jestConfig, transformerConfig, content, usesModules;
|
|
81
81
|
var _b, _c, _d;
|
|
82
82
|
return __generator(this, function (_e) {
|
|
83
83
|
file = (_c = (_b = args._[0]) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : 'jest.config.js';
|
|
@@ -157,7 +157,8 @@ var run = function (args /* , logger: Logger */) { return __awaiter(void 0, void
|
|
|
157
157
|
content.push("".concat(preset.jsImport('tsjPreset'), ";"), '');
|
|
158
158
|
}
|
|
159
159
|
content.push("/** @type {import('ts-jest').JestConfigWithTsJest} */");
|
|
160
|
-
|
|
160
|
+
usesModules = pkgJson.type === 'module';
|
|
161
|
+
content.push(usesModules ? 'export default {' : 'module.exports = {');
|
|
161
162
|
if (jestPreset) {
|
|
162
163
|
content.push(" preset: '".concat(preset.name, "',"));
|
|
163
164
|
}
|
package/dist/constants.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.DEFAULT_JEST_TEST_MATCH = exports.JS_EXT_TO_TREAT_AS_ESM = exports.TS_EX
|
|
|
4
4
|
exports.LINE_FEED = '\n';
|
|
5
5
|
exports.DECLARATION_TYPE_EXT = '.d.ts';
|
|
6
6
|
exports.JS_JSX_EXTENSIONS = ['.js', '.jsx'];
|
|
7
|
-
exports.TS_TSX_REGEX = /\.
|
|
8
|
-
exports.JS_JSX_REGEX = /\.
|
|
7
|
+
exports.TS_TSX_REGEX = /\.[cm]?tsx?$/;
|
|
8
|
+
exports.JS_JSX_REGEX = /\.[cm]?jsx?$/;
|
|
9
9
|
// `extensionsToTreatAsEsm` will throw error with `.mjs`
|
|
10
10
|
exports.TS_EXT_TO_TREAT_AS_ESM = ['.ts', '.tsx', '.mts'];
|
|
11
11
|
exports.JS_EXT_TO_TREAT_AS_ESM = ['.jsx'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-jest",
|
|
3
|
-
"version": "29.1.
|
|
3
|
+
"version": "29.1.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
|
-
"@commitlint/cli": "
|
|
97
|
-
"@commitlint/config-angular": "^
|
|
96
|
+
"@commitlint/cli": "^19.3.0",
|
|
97
|
+
"@commitlint/config-angular": "^19.3.0",
|
|
98
98
|
"@jest/transform": "^29.7.0",
|
|
99
99
|
"@jest/types": "^29.6.3",
|
|
100
100
|
"@types/babel__core": "7.20.5",
|
|
@@ -105,39 +105,39 @@
|
|
|
105
105
|
"@types/lodash.memoize": "4.1.9",
|
|
106
106
|
"@types/lodash.set": "4.3.9",
|
|
107
107
|
"@types/micromatch": "4.0.7",
|
|
108
|
-
"@types/node": "
|
|
108
|
+
"@types/node": "20.12.12",
|
|
109
109
|
"@types/react": "18.x",
|
|
110
|
-
"@types/rimraf": "^
|
|
110
|
+
"@types/rimraf": "^4.0.5",
|
|
111
111
|
"@types/semver": "latest",
|
|
112
112
|
"@types/yargs": "latest",
|
|
113
113
|
"@types/yargs-parser": "21.0.3",
|
|
114
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
115
|
-
"@typescript-eslint/parser": "^
|
|
114
|
+
"@typescript-eslint/eslint-plugin": "^7.11.0",
|
|
115
|
+
"@typescript-eslint/parser": "^7.11.0",
|
|
116
116
|
"babel-jest": "^29.7.0",
|
|
117
|
-
"conventional-changelog-cli": "
|
|
117
|
+
"conventional-changelog-cli": "^5.0.0",
|
|
118
118
|
"cross-spawn": "latest",
|
|
119
|
-
"esbuild": "~0.
|
|
120
|
-
"eslint": "^8.
|
|
121
|
-
"eslint-config-prettier": "
|
|
122
|
-
"eslint-plugin-import": "
|
|
123
|
-
"eslint-plugin-jest": "
|
|
124
|
-
"eslint-plugin-jsdoc": "
|
|
125
|
-
"eslint-plugin-prefer-arrow": "
|
|
126
|
-
"eslint-plugin-prettier": "
|
|
119
|
+
"esbuild": "~0.21.4",
|
|
120
|
+
"eslint": "^8.57.0",
|
|
121
|
+
"eslint-config-prettier": "^9.1.0",
|
|
122
|
+
"eslint-plugin-import": "^2.29.1",
|
|
123
|
+
"eslint-plugin-jest": "^28.5.0",
|
|
124
|
+
"eslint-plugin-jsdoc": "^48.2.6",
|
|
125
|
+
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
126
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
127
127
|
"execa": "5.1.1",
|
|
128
|
-
"fs-extra": "11.
|
|
128
|
+
"fs-extra": "11.2.0",
|
|
129
129
|
"glob": "^10.2.6",
|
|
130
130
|
"glob-gitignore": "latest",
|
|
131
131
|
"husky": "4.x",
|
|
132
132
|
"jest": "^29.7.0",
|
|
133
133
|
"jest-snapshot-serializer-raw": "^1.2.0",
|
|
134
134
|
"js-yaml": "latest",
|
|
135
|
-
"json-schema-to-typescript": "^13.
|
|
135
|
+
"json-schema-to-typescript": "^13.1.2",
|
|
136
136
|
"lint-staged": "latest",
|
|
137
137
|
"lodash.camelcase": "^4.3.0",
|
|
138
138
|
"lodash.set": "^4.3.2",
|
|
139
139
|
"node-fetch": "^3.3.2",
|
|
140
|
-
"prettier": "^2.
|
|
140
|
+
"prettier": "^3.2.5",
|
|
141
141
|
"typescript": "~5.1.3"
|
|
142
142
|
},
|
|
143
143
|
"lint-staged": {
|