[feature request] call afterAll() on `ctrl+c`
See original GitHub issueDo you want to request a feature or report a bug?
What is the current behavior?
When I launch a test taking way too long to run, I hit ctrl+c
to stop it. But… then afterAll
method is not called (to clean what I have done in beforeAll
).
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install
and yarn test
.
What is the expected behavior?
I wish afterAll
was called when typing ctrl+c
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:15
- Comments:15 (10 by maintainers)
Top Results From Across the Web
Detecting CTRL+C in Node.js - Stack Overflow
So basically, all you need to do is: process.on('SIGINT', () => {}); // CTRL+C process.on('SIGQUIT', () => {}); // Keyboard quit ...
Read more >66583: Ctrl-C behavior violates principle of least astonishment
The request is to behave like a shell: % mysql -D test mysql> mysql> SELECT foo, ^C mysql> mysql> SELECT * FROM really_really_big_table;...
Read more >519233 – Pressing Ctrl-C while yum downloads something ...
Anyway, in Rawhide now, Ctrl-C handling in yum is still broken: Ctrl-C once doesn't do anything immediately. After 10-20 seconds it prints: Current...
Read more >Introduction To Unix Signals Programming
Ctrl -C: Pressing this key causes the system to send an INT signal ( SIGINT ) to ... It first sends a TERM...
Read more >Undo, redo, and other shortcut key functions - Progress Software
You can use Redo command only after Undo command. Select all. CTRL+A, To perform a function on all the content in the text...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It would be nice if
globalTeardown
would also be run.Thanks @seanpoulter - it sounds like crtl+c has hooks into the subprocesses so they’re killed but when you only kill the parent jest process we don’t forward the kill to children. I would have expected Node to handle that but I guess they don’t. That’s a bug we should fix.