Skip to content

Commit 98ffb68

Browse files
clydinalan-agius4
authored andcommitted
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.
1 parent 8abfc06 commit 98ffb68

File tree

1 file changed

+9
-0
lines changed
  • packages/angular/build/src/builders/unit-test/runners/vitest

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ const VitestTestRunner: TestRunner = {
2222
const checker = new DependencyChecker(options.projectSourceRoot);
2323
checker.check('vitest');
2424

25+
// If a runnerConfig is present, only check for 'vitest' itself.
26+
// Custom configuration may include unknown browsers or other setup
27+
// that doesn't follow the default dependency requirements.
28+
if (options.runnerConfig) {
29+
checker.report();
30+
31+
return;
32+
}
33+
2534
if (options.browsers?.length) {
2635
if (process.versions.webcontainer) {
2736
checker.check('@vitest/browser-preview');

0 commit comments

Comments
 (0)