Skip to content

Commit

Permalink
fix: cancelCurrentRun awaits runningPromise (#7168)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Jan 4, 2025
1 parent 847d322 commit 1dbf514
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ export class Vitest {
async cancelCurrentRun(reason: CancelReason): Promise<void> {
this.isCancelling = true
await Promise.all(this._onCancelListeners.splice(0).map(listener => listener(reason)))
await this.runningPromise
}

/** @internal */
Expand Down
1 change: 0 additions & 1 deletion packages/vitest/src/node/stdin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export function registerConsoleShortcuts(
process.exitCode = 130

await ctx.cancelCurrentRun('keyboard-input')
await ctx.runningPromise
}
return ctx.exit(true)
}
Expand Down

0 comments on commit 1dbf514

Please sign in to comment.