Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Dec 16, 2025

This commit fixes an issue in the Vitest unit test runner where tests would sometimes fail to re-run after a compilation error was resolved in watch mode.

The issue occurred because the incremental build result's added files were not being included in the list of modified files passed to the test runner. When a file had a compilation error, it might be treated as "added" in the subsequent successful build, and previously it was ignored.

Closes #32122

This commit fixes an issue in the Vitest unit test runner where tests would sometimes fail to re-run after a compilation error was resolved in watch mode.

The issue occurred because the incremental build result's `added` files were not being included in the list of modified files passed to the test runner. When a file had a compilation error, it might be treated as "added" in the subsequent successful build, and previously it was ignored.

A new regression test has been added to `packages/angular/build/src/builders/unit-test/tests/behavior/watch_rebuild_spec.ts` to verify that tests are correctly re-run when a compilation error is fixed, even if a test failure is introduced simultaneously.
@clydin clydin added the target: patch This PR is targeted for the next patch release label Dec 16, 2025
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Dec 16, 2025
@clydin clydin added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 16, 2025
@clydin clydin merged commit edeb41c into angular:main Dec 16, 2025
65 of 66 checks passed
@clydin
Copy link
Member Author

clydin commented Dec 16, 2025

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the unit-test/error-fix-watch branch December 16, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new code is ignored after compilation error in vitest test

2 participants