◐ Shell
clean mode source ↗

fix(@angular/build): prevent unit-test vitest runner from hanging after tests complete by hebus · Pull Request #33319 · angular/angular-cli

@hebus

…er tests complete

In non-watch mode, the vitest executor disposed the Vitest instance with
`close()`, which can wait indefinitely when a worker or service keeps the
event loop alive. The process then never exits even though all tests have
completed and their results were reported.

Use `exit()` instead when not in watch mode, mirroring the `vitest run`
CLI behavior: `exit()` arms an unref'd `teardownTimeout` safety net that
force-exits the process if teardown does not settle in time, while still
performing a normal `close()` when teardown succeeds. Watch mode behavior
is unchanged.

Fixes angular#32832