@nx/vitest 22.6.0-beta.7 → 22.6.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/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.6.0-beta.7",
4
+ "version": "22.6.0-beta.9",
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.6.0-beta.7",
56
- "@nx/js": "22.6.0-beta.7",
55
+ "@nx/devkit": "22.6.0-beta.9",
56
+ "@nx/js": "22.6.0-beta.9",
57
57
  "tslib": "^2.3.0",
58
58
  "semver": "^7.6.3",
59
59
  "@phenomnomnominal/tsquery": "~6.1.4"
@@ -71,7 +71,7 @@
71
71
  }
72
72
  },
73
73
  "devDependencies": {
74
- "nx": "22.6.0-beta.7"
74
+ "nx": "22.6.0-beta.9"
75
75
  },
76
76
  "types": "./src/index.d.ts"
77
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/vitest/src/executors/test/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAQlD,wBAAsB,UAAU,CAC9B,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAuF9B;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,CAcnE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/vitest/src/executors/test/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAQlD,wBAAsB,UAAU,CAC9B,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAkG9B;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,CAcnE"}
@@ -38,7 +38,7 @@ async function getOptions(options, context, projectRoot) {
38
38
  // Filter out options that are handled specially or are parseCLI artifacts
39
39
  const {
40
40
  // Handled specially by executor
41
- testFiles: _testFiles, configFile: _configFile, mode: _mode, runMode: _runMode, reportsDirectory, coverage,
41
+ testFiles: _testFiles, configFile: _configFile, mode: _mode, runMode: _runMode, reportsDirectory, coverage, reporter, reporters,
42
42
  // parseCLI artifacts
43
43
  '--': _dashdash, color: _color, w: _w,
44
44
  // Pass through any additional Vitest options
@@ -53,9 +53,17 @@ async function getOptions(options, context, projectRoot) {
53
53
  // but leaving it here in case someone did not migrate correctly
54
54
  root: resolved?.config?.root ?? root,
55
55
  config: viteConfigPath,
56
- // Pass reporters from config so NxReporter can be merged without losing config reporters
57
- // Safe: CLI options override (not merge with) config reporters, so no duplication
58
- reporters: resolved?.config?.['test']?.reporters,
56
+ // Vitest's resolveConfig processes reporters in two steps:
57
+ // 1. options.reporters (plural) sets resolved.reporters
58
+ // 2. resolved.reporter (singular, from config) overwrites resolved.reporters
59
+ // Setting reporter to [] prevents config's reporter from overriding NxReporter
60
+ // (which is pushed onto reporters in vitest.impl.ts).
61
+ reporter: [],
62
+ reporters: reporter ??
63
+ reporters ??
64
+ // reporter (singular) has higher priority in vitest but is not declared in InlineConfig
65
+ resolved?.config?.['test']?.reporter ??
66
+ resolved?.config?.['test']?.reporters,
59
67
  coverage: {
60
68
  ...(coverage ?? {}),
61
69
  ...(reportsDirectory && { reportsDirectory }),