-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print errors when test runner is interrupted #3373
Comments
I think this would be useful improvement. Maybe we should intercept the For vitest/packages/vitest/src/node/cli-api.ts Lines 80 to 81 in c44d991
if (process.stdin.isTTY && ctx.config.watch) {
registerConsoleShortcuts(ctx)
}
+ else {
+ process.on('SIGINT', async () => {
+ await ctx.cancelCurrentRun('keyboard-input')
+ })
+ } And same for vitest/packages/vitest/src/node/stdin.ts Lines 31 to 33 in c44d991
// ctrl-c or esc
if (str === '\x03' || str === '\x1B' || (key && key.ctrl && key.name === 'c')) {
+ await ctx.cancelCurrentRun('keyboard-input')
return ctx.exit(true)
} |
Do it so that the first SIGINT starts graceful shutdown, but a second SIGINT is received it is forced terminated. |
That's great idea, I think it would work perfectly. After looking at this a while it seems that there are couple of |
Clear and concise description of the problem
Currently, if test runner is interrupted with sigint, it just exits without producing useful output.
Suggested solution
If test runner is interrupted with sigint, then the test runner should print errors before exiting.
After ^C was received, I would expect runner to provide context about
× bar
failure.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: