Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,16 @@ export class VitestExecutor implements TestExecutor {

async [Symbol.asyncDispose](): Promise<void> {
this.debugLog(DebugLogLevel.Info, 'Disposing VitestExecutor: Closing Vitest instance.');
await this.vitest?.close();
if (this.vitest && !this.options.watch) {
// In run (non-watch) mode, mirror the `vitest run` CLI by using `exit()`, which arms an
// unref'd `teardownTimeout` safety net (`process.exit()`) before closing. `close()` alone
// can wait indefinitely when a worker or service keeps the event loop alive, leaving the
// process hanging after all tests have completed.
// See https://github.com/angular/angular-cli/issues/32832
await this.vitest.exit();
} else {
await this.vitest?.close();
}
Comment thread
hebus marked this conversation as resolved.
this.debugLog(DebugLogLevel.Info, 'Vitest instance closed.');
}

Expand Down
Loading