From c86831b4a613345781fb808f5e92a747c14c57e9 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Fri, 23 Jan 2026 14:56:53 -0500 Subject: [PATCH] fix(@angular/build): loosen Vitest dependency checks when runnerConfig is used When a Vitest configuration file is provided via the `runnerConfig` option, the builder now only validates that the `vitest` package itself is installed. Checks for specific browser providers, DOM environments (jsdom/happy-dom), and coverage providers are skipped, as the custom configuration may handle these or use alternative setups that the builder cannot predict. --- .../build/src/builders/unit-test/runners/vitest/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/angular/build/src/builders/unit-test/runners/vitest/index.ts b/packages/angular/build/src/builders/unit-test/runners/vitest/index.ts index 081d635c1a2b..e3c6910aea7d 100644 --- a/packages/angular/build/src/builders/unit-test/runners/vitest/index.ts +++ b/packages/angular/build/src/builders/unit-test/runners/vitest/index.ts @@ -22,6 +22,15 @@ const VitestTestRunner: TestRunner = { const checker = new DependencyChecker(options.projectSourceRoot); checker.check('vitest'); + // If a runnerConfig is present, only check for 'vitest' itself. + // Custom configuration may include unknown browsers or other setup + // that doesn't follow the default dependency requirements. + if (options.runnerConfig) { + checker.report(); + + return; + } + if (options.browsers?.length) { if (process.versions.webcontainer) { checker.check('@vitest/browser-preview');