Skip to content

Commit 8e837b8

Browse files
authored
fix(runner): don't drop throttled task updates (#11795)
1 parent 048b564 commit 8e837b8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • packages/vitest/src/runtime/runner

‎packages/vitest/src/runtime/runner/run.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,10 @@ function throttle<T extends (...args: any[]) => void>(fn: T, ms: number): T {
513513
}
514514

515515
// Make sure fn is still called even if there are no further calls
516-
pendingCall ??= setTimeout(call.bind(this), ms, ...args)
516+
pendingCall ??= setTimeout(() => {
517+
pendingCall = undefined
518+
call.apply(this, args)
519+
}, ms)
517520
} as any
518521
}
519522

0 commit comments

Comments
 (0)