@nx/jest 19.5.7 → 19.6.0-beta.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/migrations.json CHANGED
@@ -45,6 +45,43 @@
45
45
  "alwaysAddToPackageJson": false
46
46
  }
47
47
  }
48
+ },
49
+ "19.6.0": {
50
+ "version": "19.6.0-beta.1",
51
+ "packages": {
52
+ "jest": {
53
+ "version": "~29.7.0",
54
+ "alwaysAddToPackageJson": false
55
+ },
56
+ "@types/jest": {
57
+ "version": "~29.5.12",
58
+ "alwaysAddToPackageJson": false
59
+ },
60
+ "expect": {
61
+ "version": "~29.7.0",
62
+ "alwaysAddToPackageJson": false
63
+ },
64
+ "@jest/globals": {
65
+ "version": "~29.7.0",
66
+ "alwaysAddToPackageJson": false
67
+ },
68
+ "jest-jasmine2": {
69
+ "version": "~29.7.0",
70
+ "alwaysAddToPackageJson": false
71
+ },
72
+ "jest-environment-jsdom": {
73
+ "version": "~29.7.0",
74
+ "alwaysAddToPackageJson": false
75
+ },
76
+ "ts-jest": {
77
+ "version": "~29.2.4",
78
+ "alwaysAddToPackageJson": false
79
+ },
80
+ "babel-jest": {
81
+ "version": "~29.7.0",
82
+ "alwaysAddToPackageJson": false
83
+ }
84
+ }
48
85
  }
49
86
  }
50
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/jest",
3
- "version": "19.5.7",
3
+ "version": "19.6.0-beta.1",
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": "^29.4.1",
39
39
  "@jest/test-result": "^29.4.1",
40
- "@nx/devkit": "19.5.7",
41
- "@nx/js": "19.5.7",
40
+ "@nx/devkit": "19.6.0-beta.1",
41
+ "@nx/js": "19.6.0-beta.1",
42
42
  "@phenomnomnominal/tsquery": "~5.0.1",
43
43
  "chalk": "^4.1.0",
44
44
  "identity-obj-proxy": "3.0.0",
@@ -49,7 +49,7 @@
49
49
  "resolve.exports": "1.1.0",
50
50
  "tslib": "^2.3.0",
51
51
  "yargs-parser": "21.1.1",
52
- "@nrwl/jest": "19.5.7"
52
+ "@nrwl/jest": "19.6.0-beta.1"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"
@@ -120,18 +120,13 @@ async function buildJestTargets(configFilePath, projectRoot, options, context) {
120
120
  const outputs = (target.outputs = getOutputs(projectRoot, config, context));
121
121
  let metadata;
122
122
  if (options?.ciTargetName) {
123
- // Resolve the version of `jest-runtime` that `jest` is using.
124
- const jestPath = require.resolve('jest');
125
- const jest = require(jestPath);
126
123
  // nx-ignore-next-line
127
- const { default: Runtime } = require(require.resolve('jest-runtime', {
128
- paths: [(0, path_1.dirname)(jestPath)],
129
- // nx-ignore-next-line
130
- }));
124
+ const { default: Runtime } = requireJestUtil('jest-runtime', projectRoot, context);
131
125
  const jestContext = await Runtime.createContext(config.projectConfig, {
132
126
  maxWorkers: 1,
133
127
  watchman: false,
134
128
  });
129
+ const jest = require(resolveJestPath(projectRoot, context));
135
130
  const source = new jest.SearchSource(jestContext);
136
131
  const specs = await source.getTestPaths(config.globalConfig);
137
132
  const testPaths = new Set(specs.tests.map(({ path }) => path));
@@ -268,3 +263,20 @@ function normalizeOptions(options) {
268
263
  options.targetName ??= 'test';
269
264
  return options;
270
265
  }
266
+ let resolvedJestPaths;
267
+ function resolveJestPath(projectRoot, context) {
268
+ resolvedJestPaths ??= {};
269
+ if (resolvedJestPaths[projectRoot]) {
270
+ return resolvedJestPaths[projectRoot];
271
+ }
272
+ return require.resolve('jest', {
273
+ paths: [projectRoot, context.workspaceRoot, __dirname],
274
+ });
275
+ }
276
+ /**
277
+ * Resolves a jest util package version that `jest` is using.
278
+ */
279
+ function requireJestUtil(packageName, projectRoot, context) {
280
+ const jestPath = resolveJestPath(projectRoot, context);
281
+ return require(require.resolve(packageName, { paths: [(0, path_1.dirname)(jestPath)] }));
282
+ }
@@ -1,8 +1,8 @@
1
1
  export declare const nxVersion: any;
2
- export declare const jestVersion = "^29.4.1";
3
- export declare const babelJestVersion = "^29.4.1";
4
- export declare const jestTypesVersion = "^29.4.0";
5
- export declare const tsJestVersion = "^29.1.0";
2
+ export declare const jestVersion = "^29.7.0";
3
+ export declare const babelJestVersion = "^29.7.0";
4
+ export declare const jestTypesVersion = "^29.5.12";
5
+ export declare const tsJestVersion = "^29.2.4";
6
6
  export declare const tslibVersion = "^2.3.0";
7
7
  export declare const swcJestVersion = "~0.2.36";
8
8
  export declare const typesNodeVersion = "18.16.9";
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tsNodeVersion = exports.typesNodeVersion = exports.swcJestVersion = exports.tslibVersion = exports.tsJestVersion = exports.jestTypesVersion = exports.babelJestVersion = exports.jestVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
- exports.jestVersion = '^29.4.1';
6
- exports.babelJestVersion = '^29.4.1';
7
- exports.jestTypesVersion = '^29.4.0';
8
- exports.tsJestVersion = '^29.1.0';
5
+ exports.jestVersion = '^29.7.0';
6
+ exports.babelJestVersion = '^29.7.0';
7
+ exports.jestTypesVersion = '^29.5.12';
8
+ exports.tsJestVersion = '^29.2.4';
9
9
  exports.tslibVersion = '^2.3.0';
10
10
  exports.swcJestVersion = '~0.2.36';
11
11
  exports.typesNodeVersion = '18.16.9';