Skip to content

Commit 93c5bc8

Browse files
committed
build: update vitest monorepo to v5
See associated pull request for more information. Closes #34030 as a pr takeover
1 parent 0a137f9 commit 93c5bc8

7 files changed

Lines changed: 92 additions & 159 deletions

File tree

‎modules/testing/builder/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"@angular-devkit/build-angular": "workspace:*",
55
"@angular-devkit/core": "workspace:*",
66
"@angular/ssr": "workspace:*",
7-
"@vitest/coverage-v8": "4.1.11",
7+
"@vitest/coverage-v8": "5.0.0",
88
"browser-sync": "3.0.4",
99
"istanbul-lib-instrument": "6.0.3",
1010
"jsdom": "30.0.1",
1111
"ng-packagr": "22.2.0-next.5",
1212
"rxjs": "7.8.2",
13-
"vitest": "4.1.11"
13+
"vitest": "5.0.0"
1414
}
1515
}

‎packages/angular/build/BUILD.bazel‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ ts_project(
268268
"//:node_modules/@types/node",
269269

270270
# unit test specific test deps
271+
":node_modules/@vitest/coverage-v8",
271272
":node_modules/vitest",
272273
":node_modules/jsdom",
273274

‎packages/angular/build/package.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@
5353
"@angular-devkit/core": "workspace:*",
5454
"@angular/ssr": "workspace:*",
5555
"@oxc-project/types": "0.149.0",
56+
"@vitest/coverage-v8": "5.0.0",
5657
"istanbul-lib-instrument": "6.0.3",
5758
"jsdom": "30.0.1",
5859
"less": "4.9.1",
5960
"ng-packagr": "22.2.0-next.5",
6061
"postcss": "8.5.28",
6162
"rollup": "4.63.1",
6263
"rxjs": "7.8.2",
63-
"vitest": "4.1.11"
64+
"vitest": "5.0.0"
6465
},
6566
"peerDependencies": {
6667
"@angular/compiler": "0.0.0-ANGULAR-FW-PEER-DEP",
@@ -80,7 +81,7 @@
8081
"tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0",
8182
"tslib": "^2.3.0",
8283
"typescript": ">=6.0 <6.1",
83-
"vitest": "^4.0.8"
84+
"vitest": "^4.0.8 || ^5.0.0"
8485
},
8586
"peerDependenciesMeta": {
8687
"@angular/core": {

‎packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import type {
1616
ResolvedConfig,
1717
UserWorkspaceConfig,
1818
Vite,
19-
VitestPlugin,
2019
VitestPluginContext,
2120
} from 'vitest/node';
2221
import { createBuildAssetsMiddleware } from '../../../../tools/vite/middlewares/assets-middleware';
@@ -32,8 +31,6 @@ interface ExistingRawSourceMap {
3231
mappings?: string;
3332
}
3433

35-
type VitestPlugins = Awaited<ReturnType<typeof VitestPlugin>>;
36-
3734
interface PluginOptions {
3835
workspaceRoot: string;
3936
projectSourceRoot: string;
@@ -151,7 +148,7 @@ function getBrowsersToCheck(
151148

152149
export async function createVitestConfigPlugin(
153150
options: VitestConfigPluginOptions,
154-
): Promise<VitestPlugins[0]> {
151+
): Promise<Vite.Plugin> {
155152
const {
156153
include,
157154
browser,
@@ -313,7 +310,7 @@ async function loadResultFile(file: ResultFile): Promise<string> {
313310
return readFile(file.inputPath, 'utf-8');
314311
}
315312

316-
export function createVitestPlugins(pluginOptions: PluginOptions): VitestPlugins {
313+
export function createVitestPlugins(pluginOptions: PluginOptions): Vite.Plugin[] {
317314
const { workspaceRoot, buildResultFiles, testFileToEntryPoint } = pluginOptions;
318315
const isWindows = platform() === 'win32';
319316
let vitestConfig: ResolvedConfig;

‎packages/schematics/angular/utility/latest-versions/package.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"@tailwindcss/postcss": "^4.1.12",
2626
"tslib": "^2.3.0",
2727
"typescript": "~6.0.2",
28-
"vitest": "^4.0.8",
29-
"@vitest/coverage-v8": "^4.0.8",
30-
"@vitest/coverage-istanbul": "^4.0.8",
31-
"@vitest/browser-playwright": "^4.0.8",
28+
"vitest": "^5.0.0",
29+
"@vitest/coverage-v8": "^5.0.0",
30+
"@vitest/coverage-istanbul": "^5.0.0",
31+
"@vitest/browser-playwright": "^5.0.0",
3232
"@vitest/browser-webdriverio": "^4.0.8",
33-
"@vitest/browser-preview": "^4.0.8",
33+
"@vitest/browser-preview": "^5.0.0",
3434
"playwright": "^1.48.0",
3535
"webdriverio": "^9.0.0",
3636
"zone.js": "~0.16.0"

0 commit comments

Comments
 (0)