@nx/vitest 22.4.0-beta.0 → 22.4.0-canary.20251222-d959d70

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@nx/vitest",
3
3
  "description": "The Nx Plugin for Vitest to enable fast unit testing with Vitest.",
4
- "version": "22.4.0-beta.0",
4
+ "version": "22.4.0-canary.20251222-d959d70",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -52,8 +52,8 @@
52
52
  "executors": "./executors.json",
53
53
  "generators": "./generators.json",
54
54
  "dependencies": {
55
- "@nx/devkit": "22.4.0-beta.0",
56
- "@nx/js": "22.4.0-beta.0",
55
+ "@nx/devkit": "22.4.0-canary.20251222-d959d70",
56
+ "@nx/js": "22.4.0-canary.20251222-d959d70",
57
57
  "tslib": "^2.3.0",
58
58
  "semver": "^7.6.3",
59
59
  "@phenomnomnominal/tsquery": "~5.0.1"
@@ -71,7 +71,7 @@
71
71
  }
72
72
  },
73
73
  "devDependencies": {
74
- "nx": "22.4.0-beta.0"
74
+ "nx": "22.4.0-canary.20251222-d959d70"
75
75
  },
76
76
  "types": "./src/index.d.ts"
77
77
  }
@@ -702,6 +702,14 @@ nx show project PROJECT_NAME --web
702
702
  nx reset
703
703
  ```
704
704
 
705
+ ## Guard Rails
706
+
707
+ DO NOT
708
+
709
+ - Force tests to pass by removing test logic and replacing it with `expect(true).toBe(true)`
710
+ - Remove assertions
711
+ - Add additional mocks that force tests to pass
712
+
705
713
  ---
706
714
 
707
715
  ## Notes for LLM Execution
@@ -105,6 +105,13 @@ async function buildVitestTargets(configFilePath, projectRoot, options, context)
105
105
  configFile: absoluteConfigFilePath,
106
106
  mode: 'development',
107
107
  }, 'build');
108
+ // If this is a root workspace config file with projects property, don't infer targets.
109
+ // The root config is just an orchestrator - the actual tests live in the individual project configs.
110
+ const isWorkspaceRoot = projectRoot === '.';
111
+ const hasProjectsProperty = Array.isArray(viteBuildConfig?.test?.projects);
112
+ if (isWorkspaceRoot && hasProjectsProperty) {
113
+ return { targets: {}, metadata: {}, projectType: 'library' };
114
+ }
108
115
  let metadata = {};
109
116
  const { testOutputs, hasTest } = getOutputs(viteBuildConfig, projectRoot, context.workspaceRoot);
110
117
  const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);