MCPcopy
hub / github.com/nashsu/llm_wiki / flushMicrotasks

Function flushMicrotasks

src/test-helpers/deferred.ts:41–45  ·  view source on GitHub ↗
(ticks: number = 5)

Source from the content-addressed store, hash-verified

39 * Use after triggering an async operation you want to observe mid-flight.
40 */
41export async function flushMicrotasks(ticks: number = 5): Promise<void> {
42 for (let i = 0; i < ticks; i++) {
43 await Promise.resolve()
44 }
45}
46
47/**
48 * Yield to the event loop (macrotasks) so real I/O promises (fs.writeFile,

Callers 4

waitUntilFunction · 0.90

Calls

no outgoing calls

Tested by 1

waitUntilFunction · 0.72