@nx/vitest 23.0.0-rc.4 → 23.0.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/README.md CHANGED
@@ -7,13 +7,12 @@
7
7
 
8
8
  <div style="text-align: center;">
9
9
 
10
- [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
11
10
  [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]()
12
11
  [![NPM Version](https://badge.fury.io/js/nx.svg)](https://www.npmjs.com/package/nx)
13
12
  [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
14
13
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
15
- [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
16
14
  [![Join us on the Official Nx Discord Server](https://img.shields.io/discord/1143497901675401286?label=discord)](https://go.nx.dev/community)
15
+ [![Nx Sandboxing](https://staging.nx.app/workspaces/62d013ea0852fe0a2df74438/sandbox-badge.svg)](https://nx.dev/docs/features/ci-features/sandboxing)
17
16
 
18
17
  </div>
19
18
 
@@ -20,8 +20,13 @@ async function getOptions(options, context, projectRoot) {
20
20
  You can read more here: https://nx.dev/nx-api/vitest/generators/configuration
21
21
  `);
22
22
  }
23
+ // Vitest derives the Vite config mode as `options.mode || runMode`, where
24
+ // runMode defaults to 'test' (or 'benchmark'). Resolve it once and reuse it
25
+ // for both this pre-load and the value forwarded to vitest below, so the
26
+ // config file resolves its mode-based branches identically on both loads.
27
+ const mode = options.mode ?? options.runMode ?? 'test';
23
28
  const resolved = await loadConfigFromFile({
24
- mode: options?.mode ?? 'test',
29
+ mode,
25
30
  command: 'serve',
26
31
  }, viteConfigPath);
27
32
  if (!resolved?.config?.['test']) {
@@ -54,6 +59,10 @@ async function getOptions(options, context, projectRoot) {
54
59
  // but leaving it here in case someone did not migrate correctly
55
60
  root: resolved?.config?.root ?? root,
56
61
  config: viteConfigPath,
62
+ // Forward the resolved mode so vitest reloads the config file with it;
63
+ // otherwise it falls back to its run-mode default and drops mode-based
64
+ // settings the pre-load above resolved (e.g. outputFile, coverage.reporter).
65
+ mode,
57
66
  // Vitest's resolveConfig processes reporters in two steps:
58
67
  // 1. options.reporters (plural) sets resolved.reporters
59
68
  // 2. resolved.reporter (singular, from config) overwrites resolved.reporters
@@ -14,7 +14,7 @@ export declare const vitePluginReactSwcVersion = "^4.3.0";
14
14
  export declare const jsdomVersion = "^27.1.0";
15
15
  export declare const vitePluginDtsVersion = "~4.5.0";
16
16
  export declare const ajvVersion = "^8.0.0";
17
- export declare const happyDomVersion = "~9.20.3";
17
+ export declare const happyDomVersion = "^20.10.4";
18
18
  export declare const edgeRuntimeVmVersion = "~3.0.2";
19
19
  export declare const jitiVersion = "2.4.2";
20
20
  export declare const analogVitestAngular = "~2.1.2";
@@ -23,7 +23,7 @@ exports.vitePluginReactSwcVersion = '^4.3.0';
23
23
  exports.jsdomVersion = '^27.1.0';
24
24
  exports.vitePluginDtsVersion = '~4.5.0';
25
25
  exports.ajvVersion = '^8.0.0';
26
- exports.happyDomVersion = '~9.20.3';
26
+ exports.happyDomVersion = '^20.10.4';
27
27
  exports.edgeRuntimeVmVersion = '~3.0.2';
28
28
  exports.jitiVersion = '2.4.2';
29
29
  exports.analogVitestAngular = '~2.1.2';
package/migrations.json CHANGED
@@ -109,6 +109,18 @@
109
109
  "alwaysAddToPackageJson": false
110
110
  }
111
111
  }
112
+ },
113
+ "23.0.1-happy-dom": {
114
+ "version": "23.0.1",
115
+ "requires": {
116
+ "happy-dom": "<=20.10.4"
117
+ },
118
+ "packages": {
119
+ "happy-dom": {
120
+ "version": "^20.10.4",
121
+ "alwaysAddToPackageJson": false
122
+ }
123
+ }
112
124
  }
113
125
  }
114
126
  }
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": "23.0.0-rc.4",
4
+ "version": "23.0.1",
5
5
  "type": "commonjs",
6
6
  "files": [
7
7
  "dist",
@@ -73,13 +73,13 @@
73
73
  "tslib": "^2.3.0",
74
74
  "semver": "^7.6.3",
75
75
  "@phenomnomnominal/tsquery": "~6.2.0",
76
- "@nx/devkit": "23.0.0-rc.4",
77
- "@nx/js": "23.0.0-rc.4"
76
+ "@nx/devkit": "23.0.1",
77
+ "@nx/js": "23.0.1"
78
78
  },
79
79
  "peerDependencies": {
80
80
  "vitest": "^3.0.0 || ^4.0.0",
81
81
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
82
- "@nx/eslint": "23.0.0-rc.4"
82
+ "@nx/eslint": "23.0.1"
83
83
  },
84
84
  "peerDependenciesMeta": {
85
85
  "@nx/eslint": {
@@ -93,6 +93,6 @@
93
93
  }
94
94
  },
95
95
  "devDependencies": {
96
- "nx": "23.0.0-rc.4"
96
+ "nx": "23.0.1"
97
97
  }
98
98
  }