Skip to content

Commit 1dbf514

Browse files
authored
fix: cancelCurrentRun awaits runningPromise (#7168)
1 parent 847d322 commit 1dbf514

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

packages/vitest/src/node/core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ export class Vitest {
800800
async cancelCurrentRun(reason: CancelReason): Promise<void> {
801801
this.isCancelling = true
802802
await Promise.all(this._onCancelListeners.splice(0).map(listener => listener(reason)))
803+
await this.runningPromise
803804
}
804805

805806
/** @internal */

packages/vitest/src/node/stdin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export function registerConsoleShortcuts(
6161
process.exitCode = 130
6262

6363
await ctx.cancelCurrentRun('keyboard-input')
64-
await ctx.runningPromise
6564
}
6665
return ctx.exit(true)
6766
}

0 commit comments

Comments
 (0)