@nx/jest 21.3.9 → 21.3.11
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/package.json +3 -3
- package/src/plugins/plugin.js +17 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/jest",
|
|
3
|
-
"version": "21.3.
|
|
3
|
+
"version": "21.3.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Jest contains executors and generators allowing your workspace to use the powerful Jest testing capabilities.",
|
|
6
6
|
"repository": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@jest/reporters": "^30.0.2",
|
|
39
39
|
"@jest/test-result": "^30.0.2",
|
|
40
|
-
"@nx/devkit": "21.3.
|
|
41
|
-
"@nx/js": "21.3.
|
|
40
|
+
"@nx/devkit": "21.3.11",
|
|
41
|
+
"@nx/js": "21.3.11",
|
|
42
42
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
43
43
|
"identity-obj-proxy": "3.0.0",
|
|
44
44
|
"jest-config": "^30.0.2",
|
package/src/plugins/plugin.js
CHANGED
|
@@ -15,6 +15,7 @@ const path_1 = require("path");
|
|
|
15
15
|
const workspace_context_1 = require("nx/src/utils/workspace-context");
|
|
16
16
|
const node_path_1 = require("node:path");
|
|
17
17
|
const installation_directory_1 = require("nx/src/utils/installation-directory");
|
|
18
|
+
const semver_1 = require("semver");
|
|
18
19
|
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
19
20
|
function readTargetsCache(cachePath) {
|
|
20
21
|
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
@@ -143,13 +144,26 @@ async function buildJestTargets(configFilePath, projectRoot, options, context, p
|
|
|
143
144
|
module: 'commonjs',
|
|
144
145
|
customConditions: null,
|
|
145
146
|
});
|
|
147
|
+
// Jest 30 + Node.js 24 can't parse TS configs with imports.
|
|
148
|
+
// This flag does not exist in Node 20/22.
|
|
149
|
+
// https://github.com/jestjs/jest/issues/15682
|
|
150
|
+
const nodeVersion = (0, semver_1.major)(process.version);
|
|
151
|
+
const env = {
|
|
152
|
+
TS_NODE_COMPILER_OPTIONS: tsNodeCompilerOptions,
|
|
153
|
+
};
|
|
154
|
+
if (nodeVersion >= 24) {
|
|
155
|
+
const currentOptions = process.env.NODE_OPTIONS || '';
|
|
156
|
+
if (!currentOptions.includes('--no-experimental-strip-types')) {
|
|
157
|
+
env.NODE_OPTIONS = (currentOptions + ' --no-experimental-strip-types').trim();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
146
160
|
const target = (targets[options.targetName] = {
|
|
147
161
|
command: 'jest',
|
|
148
162
|
options: {
|
|
149
163
|
cwd: projectRoot,
|
|
150
164
|
// Jest registers ts-node with module CJS https://github.com/SimenB/jest/blob/v29.6.4/packages/jest-config/src/readConfigFileAndSetRootDir.ts#L117-L119
|
|
151
165
|
// We want to support of ESM via 'module':'nodenext', we need to override the resolution until Jest supports it.
|
|
152
|
-
env
|
|
166
|
+
env,
|
|
153
167
|
},
|
|
154
168
|
metadata: {
|
|
155
169
|
technologies: ['jest'],
|
|
@@ -208,7 +222,7 @@ async function buildJestTargets(configFilePath, projectRoot, options, context, p
|
|
|
208
222
|
outputs,
|
|
209
223
|
options: {
|
|
210
224
|
cwd: projectRoot,
|
|
211
|
-
env
|
|
225
|
+
env,
|
|
212
226
|
},
|
|
213
227
|
metadata: {
|
|
214
228
|
technologies: ['jest'],
|
|
@@ -324,7 +338,7 @@ async function buildJestTargets(configFilePath, projectRoot, options, context, p
|
|
|
324
338
|
outputs,
|
|
325
339
|
options: {
|
|
326
340
|
cwd: projectRoot,
|
|
327
|
-
env
|
|
341
|
+
env,
|
|
328
342
|
},
|
|
329
343
|
metadata: {
|
|
330
344
|
technologies: ['jest'],
|