Skip to content
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

fix: add async to onFinish report event #623

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vitest/src/api/setup.ts
Expand Up @@ -146,7 +146,7 @@ class WebSocketReporter implements Reporter {
})
}

onFinished(files?: File[] | undefined) {
async onFinished(files?: File[] | undefined) {
this.clients.forEach((client) => {
client.onFinished?.(files)
})
Expand Down
4 changes: 2 additions & 2 deletions packages/vitest/src/types/reporter.ts
Expand Up @@ -4,7 +4,7 @@ import type { File, TaskResultPack } from './tasks'

export interface Reporter {
onInit?(ctx: Vitest): void
onCollected?: (files?: File[]) => Awaitable<void>
onCollected?: (files?: File[]) => void
onFinished?: (files?: File[]) => Awaitable<void>
onTaskUpdate?: (packs: TaskResultPack[]) => Awaitable<void>

Expand All @@ -13,5 +13,5 @@ export interface Reporter {

onServerRestart?: () => Awaitable<void>

onUserConsoleLog?: (log: UserConsoleLog) => Awaitable<void>
onUserConsoleLog?: (log: UserConsoleLog) => void
}