Repository navigation
Conversation
Remove the unit-test builder pre-check that failed before Vitest ran so passWithNoTests in runner config can succeed in CI when no specs exist yet.
There was a problem hiding this comment.
Code Review
This pull request removes the hardcoded error thrown when no test files are found in the Vitest builder options, allowing Vitest's native configuration (such as 'passWithNoTests') to dictate the outcome. Additionally, a new test suite has been introduced to verify that the builder correctly fails when no tests are discovered without 'passWithNoTests' enabled, and succeeds when the option is enabled in the runner configuration. I have no feedback to provide.
|
Hi @ant1quar, thank you for putting together this pull request and for wanting to improve the Vitest integration! In the Angular CLI, requiring test files to be present during If a project or library does not yet have unit tests, the recommended practice in an Angular workspace is to not configure or invoke the Because maintaining this safety check is a deliberate design choice, we will not be moving forward with this change. We appreciate your contribution and interest in improving the Angular CLI! |
|
Thanks for the detailed explanation, @alan-agius4 — that makes sense. Keeping the fail-fast guard for misconfigured globs and avoiding silent green CI is a tradeoff I hadn't weighed against watch-mode behavior. I'll close out #33055 on my side and look for a bugfix instead. |
Summary
passWithNoTests: falsepreserves existing failure behavior; enablingpassWithNoTestsinrunnerConfigallows CI to succeed on projects without specs yet.Fixes #33055
Test plan
pnpm bazel test //packages/angular/build:unit-test_integration_tests --test_filter='*no test files*'passWithNoTests: trueviarunnerConfigMade with Cursor