Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

handling ctrl + c in tests #30

Answered by fubhy
jakim929 asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, I also observed that in my first experiments with the test setup. Vitest doesn't cleanly / gracefully shutdown the worker threads when the main process is terminated. To my knowledge, there's no way for us to do anything about this sadly. If you want to spawn your instances in beforeEach and afterEach directly in the worker threads (without the global proxy), then you'll have to open an issue in the vitest repository to get this resolved. I'm not sure why it currently behaves like this and whether they'd be open to improving / changing that or not.

That said, we've since discovered that it's actually better to NOT spawn the processes in beforeEach and afterEach anyways and instead s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jakim929
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants