@nx/jest 23.0.0-beta.7 → 23.0.0-beta.9

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/migrations.json CHANGED
@@ -171,6 +171,26 @@
171
171
  "alwaysAddToPackageJson": false
172
172
  }
173
173
  }
174
+ },
175
+ "23.0.0-pin-jest-30-3-for-rn-compat": {
176
+ "version": "23.0.0-beta.9",
177
+ "requires": {
178
+ "jest": ">=30.0.0"
179
+ },
180
+ "packages": {
181
+ "jest": {
182
+ "version": "~30.3.0",
183
+ "alwaysAddToPackageJson": false
184
+ },
185
+ "babel-jest": {
186
+ "version": "~30.3.0",
187
+ "alwaysAddToPackageJson": false
188
+ },
189
+ "@types/jest": {
190
+ "version": "~30.0.0",
191
+ "alwaysAddToPackageJson": false
192
+ }
193
+ }
174
194
  }
175
195
  }
176
196
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/jest",
3
- "version": "23.0.0-beta.7",
3
+ "version": "23.0.0-beta.9",
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": {
@@ -38,14 +38,14 @@
38
38
  "dependencies": {
39
39
  "@jest/reporters": "^30.0.2",
40
40
  "@jest/test-result": "^30.0.2",
41
- "@nx/devkit": "23.0.0-beta.7",
42
- "@nx/js": "23.0.0-beta.7",
41
+ "@nx/devkit": "23.0.0-beta.9",
42
+ "@nx/js": "23.0.0-beta.9",
43
43
  "@phenomnomnominal/tsquery": "~6.2.0",
44
44
  "identity-obj-proxy": "3.0.0",
45
45
  "jest-config": "^30.0.2",
46
46
  "jest-resolve": "^30.0.2",
47
47
  "jest-util": "^30.0.2",
48
- "minimatch": "10.2.4",
48
+ "minimatch": "10.2.5",
49
49
  "picocolors": "^1.1.0",
50
50
  "resolve.exports": "2.0.3",
51
51
  "semver": "^7.6.3",
@@ -53,7 +53,7 @@
53
53
  "yargs-parser": "21.1.1"
54
54
  },
55
55
  "devDependencies": {
56
- "nx": "23.0.0-beta.7"
56
+ "nx": "23.0.0-beta.9"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"
@@ -1 +1 @@
1
- {"version":3,"file":"jest.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/jest/src/executors/jest/jest.impl.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,eAAe,EAEf,SAAS,EAEV,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAG7E,wBAAsB,YAAY,CAChC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAe/B;AAiBD,wBAAsB,eAAe,CACnC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe,EACxB,aAAa,UAAQ,GACpB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAqGtB;AAED,eAAe,YAAY,CAAC;AAE5B,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAC3C,SAAS,EAAE,mBAAmB,EAC9B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,YAAY,CAAC,CA8FvB"}
1
+ {"version":3,"file":"jest.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/jest/src/executors/jest/jest.impl.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,eAAe,EAEf,SAAS,EAEV,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAI7E,wBAAsB,YAAY,CAChC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAiB/B;AAiBD,wBAAsB,eAAe,CACnC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe,EACxB,aAAa,UAAQ,GACpB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAqGtB;AAED,eAAe,YAAY,CAAC;AAE5B,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAC3C,SAAS,EAAE,mBAAmB,EAC9B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,YAAY,CAAC,CA8FvB"}
@@ -13,8 +13,10 @@ const path_1 = require("path");
13
13
  const devkit_1 = require("@nx/devkit");
14
14
  const summary_1 = require("./summary");
15
15
  const fs_1 = require("fs");
16
+ const deprecation_1 = require("../../utils/deprecation");
16
17
  process.env.NODE_ENV ??= 'test';
17
18
  async function jestExecutor(options, context) {
19
+ (0, deprecation_1.warnJestExecutorDeprecation)();
18
20
  // Jest registers ts-node with module CJS https://github.com/SimenB/jest/blob/v29.6.4/packages/jest-config/src/readConfigFileAndSetRootDir.ts#L117-L119
19
21
  // We want to support of ESM via 'module':'nodenext', we need to override the resolution until Jest supports it.
20
22
  const existingValue = process.env['TS_NODE_COMPILER_OPTIONS'];
@@ -5,6 +5,7 @@
5
5
  "description": "Jest target options for Build Facade.",
6
6
  "cli": "nx",
7
7
  "type": "object",
8
+ "x-deprecated": "The `@nx/jest:jest` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/jest:convert-to-inferred` to migrate to the `@nx/jest/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
8
9
  "presets": [
9
10
  {
10
11
  "name": "Pass Without Tests",
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/jest/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAKjB,IAAI,EAEL,MAAM,YAAY,CAAC;AAgBpB,OAAO,EAAE,iBAAiB,EAA+B,MAAM,UAAU,CAAC;AAyD1E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,8BAE3E;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAiE5B;AAgBD,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/jest/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAKjB,IAAI,EAEL,MAAM,YAAY,CAAC;AAiBpB,OAAO,EAAE,iBAAiB,EAA+B,MAAM,UAAU,CAAC;AAyD1E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,8BAE3E;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAkE5B;AAgBD,eAAe,sBAAsB,CAAC"}
@@ -7,6 +7,7 @@ const js_1 = require("@nx/js");
7
7
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
8
8
  const config_file_1 = require("../../utils/config/config-file");
9
9
  const init_1 = require("../init/init");
10
+ const deprecation_1 = require("../../utils/deprecation");
10
11
  const check_for_test_target_1 = require("./lib/check-for-test-target");
11
12
  const create_files_1 = require("./lib/create-files");
12
13
  const create_jest_config_1 = require("./lib/create-jest-config");
@@ -88,6 +89,7 @@ async function configurationGeneratorInternal(tree, schema) {
88
89
  }
89
90
  });
90
91
  if (!hasPlugin || options.addExplicitTargets) {
92
+ (0, deprecation_1.warnJestExecutorGenerating)();
91
93
  (0, update_workspace_1.updateWorkspace)(tree, options);
92
94
  }
93
95
  if (options.isTsSolutionSetup) {
@@ -0,0 +1,4 @@
1
+ export declare const JEST_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/jest:jest` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/jest:convert-to-inferred` to migrate to the `@nx/jest/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
2
+ export declare function warnJestExecutorDeprecation(): void;
3
+ export declare function warnJestExecutorGenerating(): void;
4
+ //# sourceMappingURL=deprecation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../../../packages/jest/src/utils/deprecation.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iCAAiC,2PAC4M,CAAC;AAE3P,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AAED,wBAAgB,0BAA0B,IAAI,IAAI,CAIjD"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JEST_EXECUTOR_DEPRECATION_MESSAGE = void 0;
4
+ exports.warnJestExecutorDeprecation = warnJestExecutorDeprecation;
5
+ exports.warnJestExecutorGenerating = warnJestExecutorGenerating;
6
+ const devkit_1 = require("@nx/devkit");
7
+ // TODO(v24): Remove the @nx/jest:jest executor. The inferred plugin
8
+ // (@nx/jest/plugin) and the convert-to-inferred generator stay supported.
9
+ exports.JEST_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/jest:jest` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/jest:convert-to-inferred` to migrate to the `@nx/jest/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
10
+ function warnJestExecutorDeprecation() {
11
+ devkit_1.logger.warn(exports.JEST_EXECUTOR_DEPRECATION_MESSAGE);
12
+ }
13
+ function warnJestExecutorGenerating() {
14
+ devkit_1.logger.warn('Generating a target that uses the deprecated `@nx/jest:jest` executor. The executor will be removed in Nx v24. Run `nx g @nx/jest:convert-to-inferred` next to migrate this target to the `@nx/jest/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
15
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/jest/src/utils/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAK5E,eAAO,MAAM,cAAc;;;;;;;;;;CAU1B,CAAC;AAEF,QAAA,MAAM,sBAAsB,mBAAoB,CAAC;AAIjD,KAAK,iBAAiB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AACjE,KAAK,mBAAmB,GAAG,MAAM,OAAO,cAAc,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG;KACtB,GAAG,IAAI,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC;CAChE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAaxB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,OAiBlC;AAED,wBAAgB,uBAAuB,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAclE;AAED,wBAAgB,2BAA2B,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG;IACxD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAMA;AAED,wBAAgB,4BAA4B,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAIvE;AAED,wBAAgB,4BAA4B,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAc9D"}
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/jest/src/utils/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAU5E,eAAO,MAAM,cAAc;;;;;;;;;;CAU1B,CAAC;AAEF,QAAA,MAAM,sBAAsB,mBAAoB,CAAC;AAIjD,KAAK,iBAAiB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AACjE,KAAK,mBAAmB,GAAG,MAAM,OAAO,cAAc,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG;KACtB,GAAG,IAAI,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC;CAChE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAaxB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,OAiBlC;AAED,wBAAgB,uBAAuB,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAclE;AAED,wBAAgB,2BAA2B,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG;IACxD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAMA;AAED,wBAAgB,4BAA4B,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAIvE;AAED,wBAAgB,4BAA4B,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAc9D"}
@@ -9,15 +9,20 @@ exports.validateInstalledJestVersion = validateInstalledJestVersion;
9
9
  const devkit_1 = require("@nx/devkit");
10
10
  const semver_1 = require("semver");
11
11
  const nxVersion = require('../../package.json').version;
12
+ // Jest is pinned to 30.3.x because jest-runtime@30.4.0 added a call to
13
+ // `_moduleMocker.clearMocksOnScope()`, which doesn't exist on the
14
+ // jest-mock@29 ModuleMocker that React Native's preset still feeds in
15
+ // (via `@react-native/jest-preset`'s pinned `jest-environment-node@^29.7.0`).
16
+ // Lift this once Meta ships a Jest-30-aware preset on react-native.
12
17
  exports.latestVersions = {
13
18
  nxVersion,
14
- jestVersion: '^30.0.2',
15
- babelJestVersion: '^30.0.2',
16
- jestTypesVersion: '^30.0.0',
19
+ jestVersion: '~30.3.0',
20
+ babelJestVersion: '~30.3.0',
21
+ jestTypesVersion: '~30.0.0',
17
22
  tsJestVersion: '^29.4.0',
18
23
  tslibVersion: '^2.3.0',
19
24
  swcJestVersion: '~0.2.38',
20
- typesNodeVersion: '20.19.9',
25
+ typesNodeVersion: '^22.0.0',
21
26
  tsNodeVersion: '10.9.1',
22
27
  };
23
28
  const supportedMajorVersions = [29, 30];