Skip to content

Commit

Permalink
fix: console log not visible (#2943)
Browse files Browse the repository at this point in the history
Fixes #2943
  • Loading branch information
AriPerkkio authored Mar 1, 2023
1 parent bce5a9f commit 0280825
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vitest/src/runtime/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ function withSafeTimers(fn: () => void) {

const promises = new Set<Promise<unknown>>()

export const rpcDone = () => {
export const rpcDone = async () => {
// Run possible setTimeouts, e.g. the onces used by ConsoleLogSpy
const { setTimeout } = getSafeTimers()
await new Promise(resolve => setTimeout(resolve))

if (!promises.size)
return
const awaitable = Array.from(promises)
Expand Down

0 comments on commit 0280825

Please sign in to comment.