ensure old tests can exit properly on using the new closeAllWatchers

This commit is contained in:
Nacho Codoñer
2025-04-23 12:39:16 +02:00
parent 69e6e55ba3
commit dc17c9003f
2 changed files with 16 additions and 2 deletions

View File

@@ -172,6 +172,13 @@ makeGlobalAsyncLocalStorage().run(
// Allow the process to exit normally, since optimistic file watchers
// may be keeping the event loop busy.
safeWatcher.closeAllWatchers();
safeWatcher.closeAllWatchers()
.then(() => {
process.exit(0);
})
.catch(err => {
console.error(`Error closing watchers:`, err);
process.exit(1);
});
}
);

View File

@@ -200,6 +200,13 @@ makeGlobalAsyncLocalStorage().run(
// Allow the process to exit normally, since optimistic file watchers
// may be keeping the event loop busy.
safeWatcher.closeAllWatchers();
safeWatcher.closeAllWatchers()
.then(() => {
process.exit(0);
})
.catch(err => {
console.error(`Error closing watchers:`, err);
process.exit(1);
});
}
);