Skip to content

Commit 0280825

Browse files
authoredMar 1, 2023
fix: console log not visible (#2943)
Fixes #2943
1 parent bce5a9f commit 0280825

File tree

1 file changed

+5
-1
lines changed
  • packages/vitest/src/runtime

1 file changed

+5
-1
lines changed
 

‎packages/vitest/src/runtime/rpc.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ function withSafeTimers(fn: () => void) {
4141

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

44-
export const rpcDone = () => {
44+
export const rpcDone = async () => {
45+
// Run possible setTimeouts, e.g. the onces used by ConsoleLogSpy
46+
const { setTimeout } = getSafeTimers()
47+
await new Promise(resolve => setTimeout(resolve))
48+
4549
if (!promises.size)
4650
return
4751
const awaitable = Array.from(promises)

0 commit comments

Comments
 (0)
Please sign in to comment.