@nx/jest 20.4.3 → 20.5.0-beta.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/jest",
3
- "version": "20.4.3",
3
+ "version": "20.5.0-beta.0",
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": "20.4.3",
41
- "@nx/js": "20.4.3",
40
+ "@nx/devkit": "20.5.0-beta.0",
41
+ "@nx/js": "20.5.0-beta.0",
42
42
  "@phenomnomnominal/tsquery": "~5.0.1",
43
43
  "identity-obj-proxy": "3.0.0",
44
44
  "jest-config": "^29.4.1",
@@ -5,6 +5,6 @@ import type { BatchResults } from 'nx/src/tasks-runner/batch/batch-messages';
5
5
  export declare function jestExecutor(options: JestExecutorOptions, context: ExecutorContext): Promise<{
6
6
  success: boolean;
7
7
  }>;
8
- export declare function parseJestConfig(options: JestExecutorOptions, context: ExecutorContext, multiProjects?: boolean): Promise<Config.Argv>;
8
+ export declare function jestConfigParser(options: JestExecutorOptions, context: ExecutorContext, multiProjects?: boolean): Promise<Config.Argv>;
9
9
  export default jestExecutor;
10
10
  export declare function batchJest(taskGraph: TaskGraph, inputs: Record<string, JestExecutorOptions>, overrides: JestExecutorOptions, context: ExecutorContext): Promise<BatchResults>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jestExecutor = jestExecutor;
4
- exports.parseJestConfig = parseJestConfig;
4
+ exports.jestConfigParser = jestConfigParser;
5
5
  exports.batchJest = batchJest;
6
6
  const jest_1 = require("jest");
7
7
  const jest_config_1 = require("jest-config");
@@ -17,7 +17,7 @@ async function jestExecutor(options, context) {
17
17
  // Jest registers ts-node with module CJS https://github.com/SimenB/jest/blob/v29.6.4/packages/jest-config/src/readConfigFileAndSetRootDir.ts#L117-L119
18
18
  // We want to support of ESM via 'module':'nodenext', we need to override the resolution until Jest supports it.
19
19
  process.env.TS_NODE_COMPILER_OPTIONS ??= '{"moduleResolution":"node10"}';
20
- const config = await parseJestConfig(options, context);
20
+ const config = await jestConfigParser(options, context);
21
21
  const { results } = await (0, jest_1.runCLI)(config, [options.jestConfig]);
22
22
  return { success: results.success };
23
23
  }
@@ -26,12 +26,11 @@ function getExtraArgs(options, schema) {
26
26
  for (const key of Object.keys(options)) {
27
27
  if (!schema.properties[key]) {
28
28
  extraArgs[key] = options[key];
29
- process.argv.push(`--${key}=${options[key]}`);
30
29
  }
31
30
  }
32
31
  return extraArgs;
33
32
  }
34
- async function parseJestConfig(options, context, multiProjects = false) {
33
+ async function jestConfigParser(options, context, multiProjects = false) {
35
34
  let jestConfig;
36
35
  // support passing extra args to jest cli supporting 3rd party plugins
37
36
  // like 'jest-runner-groups' --group arg
@@ -140,7 +139,7 @@ async function batchJest(taskGraph, inputs, overrides, context) {
140
139
  ${projectsWithNoName.map(([project, configPath]) => ` - ${project} - ${configPath}\r\n`)}
141
140
  You can learn more about this requirement from Jest here: https://jestjs.io/docs/cli#--selectprojects-project1--projectn`);
142
141
  }
143
- const parsedConfigs = await parseJestConfig(overrides, context, true);
142
+ const parsedConfigs = await jestConfigParser(overrides, context, true);
144
143
  const { globalConfig, results } = await (0, jest_1.runCLI)({
145
144
  ...parsedConfigs,
146
145
  selectProjects: selectedProjects,