@nx/jest 20.5.0-beta.0 → 20.5.0-beta.2

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.5.0-beta.0",
3
+ "version": "20.5.0-beta.2",
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.5.0-beta.0",
41
- "@nx/js": "20.5.0-beta.0",
40
+ "@nx/devkit": "20.5.0-beta.2",
41
+ "@nx/js": "20.5.0-beta.2",
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 jestConfigParser(options: JestExecutorOptions, context: ExecutorContext, multiProjects?: boolean): Promise<Config.Argv>;
8
+ export declare function parseJestConfig(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.jestConfigParser = jestConfigParser;
4
+ exports.parseJestConfig = parseJestConfig;
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 jestConfigParser(options, context);
20
+ const config = await parseJestConfig(options, context);
21
21
  const { results } = await (0, jest_1.runCLI)(config, [options.jestConfig]);
22
22
  return { success: results.success };
23
23
  }
@@ -26,11 +26,12 @@ 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]}`);
29
30
  }
30
31
  }
31
32
  return extraArgs;
32
33
  }
33
- async function jestConfigParser(options, context, multiProjects = false) {
34
+ async function parseJestConfig(options, context, multiProjects = false) {
34
35
  let jestConfig;
35
36
  // support passing extra args to jest cli supporting 3rd party plugins
36
37
  // like 'jest-runner-groups' --group arg
@@ -139,7 +140,7 @@ async function batchJest(taskGraph, inputs, overrides, context) {
139
140
  ${projectsWithNoName.map(([project, configPath]) => ` - ${project} - ${configPath}\r\n`)}
140
141
  You can learn more about this requirement from Jest here: https://jestjs.io/docs/cli#--selectprojects-project1--projectn`);
141
142
  }
142
- const parsedConfigs = await jestConfigParser(overrides, context, true);
143
+ const parsedConfigs = await parseJestConfig(overrides, context, true);
143
144
  const { globalConfig, results } = await (0, jest_1.runCLI)({
144
145
  ...parsedConfigs,
145
146
  selectProjects: selectedProjects,